Gallery3 with short_open_tag off
Posted by Daniel | Posted in Development, PHP, Software | Posted on January 28, 2012
0
If you are on a host that has short_open_tag off you won’t be able to use the latest Gallery 3 version(as of this writing). The developers have made this a requirement to allow template development to be a little simpler:
Why do you use PHP’s short open tags?
Short open tags are considered harmful by some, but they result in much tighter syntax in our PHP based templates. Here are some possible ways to print ‘Hello World’ in different template systems:
PHP long tags: <?php echo $Hello_World ?> php short tags: <?= $Hello_World ?> ASP: {% $Hello_World %} Django: {{Hello_World}} Smarty: {Hello_World}As you can see, PHP with long tags is the noisiest. The main reason for deprecating short tags is because the <? token conflicts with XML tags. In our case, this is highly unlikely to ever be a problem, and even if it is it’s a vanishingly small edge case. We’re optimizing for a good developer experience here by requiring them to type less to do more. If at some point PHP short tags goes away, we can pretty easily convert the entire app over to using long tags.
Short open tags will still be enabled by default in all future versions of PHP. While there was initially an idea to change this in PHP 6, plans have changed and short open tags are here to stay.
Source: http://codex.gallery2.org/Gallery3:FAQ#Why_do_you_use_PHP.27s_short_open_tags.3F
So, if your host doesn’t have short tags on, or if you just don’t like to use code that requires them in general you can try out this fork I made of Gallery v3 on github:





