Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532618 - >=dev-php/smarty-3.1.12: missing RDEPEND on php[unicode]
Summary: >=dev-php/smarty-3.1.12: missing RDEPEND on php[unicode]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-15 05:23 UTC by Michael Orlitzky
Modified: 2015-01-13 02:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
smarty-3.1.21-r1.ebuild (smarty-3.1.21-r1.ebuild,1010 bytes, text/plain)
2014-12-31 01:59 UTC, Michael Orlitzky
Details
smarty-3.1.21-r1.ebuild (smarty-3.1.21-r1.ebuild,1.28 KB, text/plain)
2015-01-01 14:10 UTC, Michael Orlitzky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2014-12-15 05:23:12 UTC
With php[-unicode], the mbstring extension is disabled:

  ...
  $(use_enable unicode mbstring )
  ...

Then:

Dec 15 00:05:36 [apache2] PHP Fatal error:  Call to undefined function mb_convert_encoding() in /blah/blah/blah/smarty/templates_c/bb509dfa0bfe4bbc28dbf912392f392ac9875736.file.header.tpl.php on line 69
Comment 1 Michael Orlitzky gentoo-dev 2014-12-31 01:59:59 UTC
Created attachment 392724 [details]
smarty-3.1.21-r1.ebuild

I'll revbump to fix this if no one objects. I've also cleaned up the usage instructions (now a lot simpler), and fixed the LICENSE which changed somewhere along the way.
Comment 2 Michael Orlitzky gentoo-dev 2015-01-01 14:07:15 UTC
The situation isn't as clear-cut as I thought. The mbstring detection in Smarty is automagic, at runtime. But if php[unicode] is present when someone visits your site, the cached template that is generated will use the mb_foo functions requiring php[unicode].

If you later reinstall php *without* USE=unicode, then all of those previously-generated templates will begin to crash. For that reason, I think it's best to require php[unicode] unconditionally.

Here are the steps to reproduce:

1. Install PHP with the mbstring extension
2. Install smarty
3. Clear out your templates_c directory.
4. Restart apache
5. Visit your site, on a page that uses escaping
6. A cached template is stored in $smarty_dir/templates_c that makes use of mb_convert_encoding.
7. Reinstall PHP, this time without mbstring
8. Restart apache
9. Visit the same page
10. 500 error, missing mb_* functions.
Comment 3 Michael Orlitzky gentoo-dev 2015-01-01 14:10:00 UTC
Created attachment 392864 [details]
smarty-3.1.21-r1.ebuild

Added a comment to the ebuild's RDEPEND.
Comment 4 Michael Orlitzky gentoo-dev 2015-01-13 02:04:22 UTC
  13 Jan 2015; Michael Orlitzky <mjo@gentoo.org> +smarty-3.1.21-r1.ebuild,
  -smarty-3.1.21.ebuild:
  Revbump fixing LICENSE and missing RDEPEND, bug #532618.