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

With PHP7, in template extending scenario, the compiled template misses sha1 prefix #205

Closed
lubobill1990 opened this issue Mar 23, 2016 · 6 comments

Comments

@lubobill1990
Copy link

Hi Smarty team,

Thank you for your template engine, it helps us a lot in our project of http://MyDocumate.com. But we meet with an issue recently when we are trying to upgrade to PHP7.

For example, we have multiple layout files in different directories with the same name, main.tpl as an instance.

When there are two different templates, extending from these two different main.tpl, the anticipated file name of compiled main.php should be [some sha1 prefix]_0_main.php, but in the smarty compiled directory, only _0_main,php exists, without the sha1 prefix.

When we rollback to PHP5.6, this problem disappears.

We have tried to solve this problem, but the smarty engine is too complicated for us to debug, so I'm here asking for your help.

Best Regards

@uwetews
Copy link
Contributor

uwetews commented Mar 23, 2016

I cant' reproduce your problem
Which Smarty version? which PHP7 version?

@lubobill1990
Copy link
Author

@uwetews
Hi uwetews,
After some check, I find that this issue is not caused by template extending, but caused by including a file path which will have to call default_template_handler_func to generate the absolute path.

@lubobill1990
Copy link
Author

@uwetews after some debug work, I find that it's because the $source->uid is not calculated after call_user_func_array to $default_handler

@lubobill1990
Copy link
Author

@uwetews my proposed fix is like #217 , is it right?

@uwetews
Copy link
Contributor

uwetews commented Apr 14, 2016

Your fix is now in the master branch

@uwetews uwetews closed this as completed Apr 14, 2016
@lubobill1990
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants