Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Find old templates when upgrading

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
gordonisnz
Smarty Regular


Joined: 05 Sep 2009
Posts: 70

PostPosted: Sat Dec 12, 2020 5:27 am    Post subject: Find old templates when upgrading Reply with quote

Hello. I have the following text in some templates

Code:

{include file="$_lang/$_format/standard/header.tpl"}
{include file="$_lang/$_format/menu_top.tpl"}


Im basically moving old templates into the /standard/ directory (header, footer, etc that are used on most pages. )

And I'll also upgrade other pages as well. I am wondering what other people do - to locate templates still using old templates WITHOUT just renaming them / moving them out of the directory - thus causing errors on the public pages when templates are not found.

Is there a way to put a date on each template, & have SMARTY create a report / log of any template it locates that are over 6, or 12 months old (or havnt got this date ?)

Or other method ?


I have about 4-5 subdomains & 50+ templates spread across each subdomain i'll want to check & improve/upgrade. (each subdomain has separate root directories)


PS - log idea (a config file to turn on/off the log - after you've checked them all.. )
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Dec 12, 2020 8:09 am    Post subject: Reply with quote

You first create acceptance tests. Then the problem is reduced to re-running the tests after each change.
Back to top
View user's profile Send private message
gordonisnz
Smarty Regular


Joined: 05 Sep 2009
Posts: 70

PostPosted: Sat Dec 12, 2020 8:11 am    Post subject: Reply with quote

Ive created a PHP script to look for specific comments (a date) and sort the dates / template names..

But its not a smarty process. BUT will be useful if someone creates a routine within the Smarty process.
Back to top
View user's profile Send private message
gordonisnz
Smarty Regular


Joined: 05 Sep 2009
Posts: 70

PostPosted: Sat Dec 12, 2020 8:12 am    Post subject: Reply with quote

AnrDaemon wrote:
You first create acceptance tests. Then the problem is reduced to re-running the tests after each change.


What / How is an acceptance test


EDITED:-

In Dec 2020 I decide to upgrade my templates.

I have 45 templates that call or use /html/footer.tpl

I update them as needed to /html/standard/footer.tpl.

I then delete /html/footer.tpl - but 3 months later in Feb 2021, I find several of my pages that i dont check frequently are still using the (now deleted) /html/footer.tpl & causing errors on my public website.

How does an acceptance test find pages using the old but VALID /html/footer.tpl template ? (before i delete it)?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Dec 15, 2020 1:46 am    Post subject: Reply with quote

They find that after you delete it.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP