Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Third-Party Extension Certification Program
 
seldon
Sr. Member
 
Total Posts:  92
Joined:  2007-11-08
 
Matti Ressler - 14 November 2007 07:01 AM

Short tags should be nuked oh oh

Whats the problem with short-tags? In my opinion it only makes the templates more readable.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 
seldon - 15 November 2007 03:02 AM

Matti Ressler - 14 November 2007 07:01 AM
Short tags should be nuked oh oh

Whats the problem with short-tags? In my opinion it only makes the templates more readable.

It’s turned off by default when you install PHP 5 using the recommended settings.  Straight from the php.ini-recommended file:

Allow the <? tag.  Otherwiseonly <?php and <scripttags are recognized.
NOTEUsing short tags should be avoided when developing applications or
libraries that are meant for redistribution, or deployment on PHP
servers which are not under your controlbecause short tags may not
be supported on the target server. For portableredistributable code,
be sure not to use short tags.
short_open_tag Off
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@i960: “because short tags may not be supported on the target server” - short_open_tag is PHP_INI_PERDIR, meaning can be easily overriden in local php.ini or .htaccess

If this is the only reason why not to use them, i do not think it outweights the convenience of using them…

Comments are welcome smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ruud_100
Jr. Member
 
Total Posts:  3
Joined:  2007-09-08
 

Be aware of an open third party place. Make a certification program with at least the following needs:
- min. tested by 25 beta testers
- Only stable versions on magneto site
- An interface like sourceforge, so every project his own subdomain

I think when you take the time, and set up a third party network that this will be a great step for Magento’s future

 
Magento Community Magento Community
Magento Community
Magento Community
 
zburnham
Member
 
Avatar
Total Posts:  69
Joined:  2007-11-07
Westborough, MA
 
Moshe - 15 November 2007 02:00 PM

@i960: “because short tags may not be supported on the target server” - short_open_tag is PHP_INI_PERDIR, meaning can be easily overriden in local php.ini or .htaccess

If this is the only reason why not to use them, i do not think it outweights the convenience of using them…

Comments are welcome smile

Well if you like getting hundreds of support requests because they’re not enabled by default (and not everyone has the option of turning them on), then I guess they’re fine.  It also makes putting an <?xml… ?> declaration in the template problematic at best.

Also, <? may be removed in a future version of PHP, and <?php will always be around. IMHO it’s worth it for the forward compatibility alone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@zburnham: just for the argument sake, <? is not being deprecated, and probably for a good reason smile

http://www.php.net/~derick/meeting-notes.html#remove-support-for-and-script-language-php-and-add-php-var

The <?xml .. ?> is being solved by “a patch that disallows mixing different open/close tags”.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zburnham
Member
 
Avatar
Total Posts:  69
Joined:  2007-11-07
Westborough, MA
 
Moshe - 31 January 2008 09:40 AM

@zburnham: just for the argument sake, <? is not being deprecated, and probably for a good reason smile

http://www.php.net/~derick/meeting-notes.html#remove-support-for-and-script-language-php-and-add-php-var

The <?xml .. ?> is being solved by “a patch that disallows mixing different open/close tags”.

I’ve just spoken to Derick, and have confirmed that that patch will not be implemented.  You are correct in that the short open tag is not going to be deprecated, for backwards compatibility reasons. 

So xml declarations will continue to be a problem.  This, combined with the portability issue (not working as distributed on a default installation of PHP) really should be enough IMHO.  (Plus, if it’s relevant, the short tag is not allowed by the Zend Framework coding standard, see the standard definition)
I’ll volunteer to fix the code if you want me to.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark_Kimsal
Sr. Member
 
Total Posts:  186
Joined:  2007-09-12
Michigan, USA
 
zburnham - 31 January 2008 09:31 AM

It also makes putting an <?xml… ?> declaration in the template problematic at best.

I absolutely hate this reason, since <?xml (with a space after it) is a syntax error in PHP, there is absolutely no reason that the parser cannot check for the letters “x” “m” and “l” when short tags is on.  In fact, a number of patches that solve this problem have been submitted to the php-dev list and flatly rejected w/o reason.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

We’re considering making this switch ourselves… The only thing bothering us is “<?=” vs “<?php echo “ for every variable… Ugly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zburnham
Member
 
Avatar
Total Posts:  69
Joined:  2007-11-07
Westborough, MA
 
Moshe - 31 January 2008 10:41 AM

We’re considering making this switch ourselves… The only thing bothering us is “<?=” vs “<?php echo “ for every variable… Ugly.

I agree it’s not as nice to look at, but if it’s a choice between the code being a little ugly and being required to change php.ini for Magento to work correctly… well, that’s left as an exercise for the reader smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@zburnham: we’ve got i think no more than 10 people that had problem with this, and just needed to edit Allowoverride All to allow .htaccess to be loaded.

Out of thousands of people that downloaded it. I’m not sure that’s a big problem really..

 
Magento Community Magento Community
Magento Community
Magento Community
 
zburnham
Member
 
Avatar
Total Posts:  69
Joined:  2007-11-07
Westborough, MA
 
Moshe - 31 January 2008 01:30 PM

@zburnham: we’ve got i think no more than 10 people that had problem with this, and just needed to edit Allowoverride All to allow .htaccess to be loaded.

Out of thousands of people that downloaded it. I’m not sure that’s a big problem really..

If that’s what you’ve seen, then maybe you’re right, it’s not a huge deal.. but I think the fact that it’s still in beta might be a factor there.  The people who are futzing with it right now (I’m assuming here) are mostly coders or other highly technical people themselves, and would have the access and the knowledge to figure out the short tags issue.. once it’s released, I think that could change.

 
Magento Community Magento Community
Magento Community
Magento Community
 
BehrendsTech
Jr. Member
 
Total Posts:  2
Joined:  2008-02-02
 

I think, that certified 3rd party should just have a seal for the version or something similar.  The reason for this is when a bug is discovered to wait for 25 users to test a simple fix or for it to get certified is just too long. Beta or “pending” versions should be available, remember that it’s open source and someone can find a fix in a hour, it might take the original developer days to weeks to get it certified.  If you have a full running shop where u have visitors 24/7 thats just to long to wait for a “fix”.  My issue with using support threads for “fixes” or updates is you gotta go through everyones questions, comments and issues just to fix the latest “fix”.

Thats just my 2cents, hope i give you some ideas, comments welcome smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
SimpleHelixcom
Enthusiast
 
Avatar
Total Posts:  906
Joined:  2007-08-31
Huntsville, AL
 

Ahh the good ol’ short tag vs long tag debate =)

I also am a huge fan of short tags for obvious reasons but at the same time concerned about compatibility problems in the future down the line.

I think from a programmer’s point of view, enabling short tags allows greater readability in their codes, which means less bugs and more efficient programming.

I really wish PHP would keep the short tag on a permanent basis.

I wish the PHP guys come out with that patch, it seems like it wouldn’t be too hard to implement =p

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2