Quick question
Moderator: General Moderators
Quick question
Hey guys, I'm just wondering what is the setting in PHP.ini that I need to change in order to enable/disable this:
<?=$page?> (this is the same as <? echo $page;?>)
Thanks!
<?=$page?> (this is the same as <? echo $page;?>)
Thanks!
Re: Quick question
Flamie wrote:Hey guys, I'm just wondering what is the setting in PHP.ini that I need to change in order to enable/disable this:
<?=$page?> (this is the same as <? echo $page;?>)
Thanks!
Code: Select all
short_open_tag = OnDescriptive subjects
Code: Select all
Never enable it. Ever.And to flamie:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Re: Descriptive subjects
Not true. You have three options:The Ninja Space Goat wrote:Sometimes you need to enable it. Some people write applications with the short open tag on unfortunately.For instance... magento...
.
- modify the code yourself to not use it -- fairly easy.
- push the developer(s) to fix their code -- can be challenging.
- use a different codebase that is written correctly -- variable difficulty depending on the niche level of the library in question.
In the real world with project deadlines none of these options are practical or realistic.
there are most definitely exceptions.
Magento's codebase is huge and it's riddled with <?=$this?> and <? everywhere. There is no easy way to remove them. Even if there was, you have to do it again every time you update.1. modify the code yourself to not use it -- fairly easy.
Like you said this can be challenging. Eventually I have a feeling magento will change this, but I wouldn't count on that any time soon.2. push the developer(s) to fix their code -- can be challenging.
Find another decent PHP ecommerce app with the features magento has. It is totally worth turning on short_open_tags to get the functionality magento provides.3. use a different codebase that is written correctly -- variable difficulty depending on the niche level of the library in question.
there are most definitely exceptions.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
There's a simple, easy way. You can easily write an adapter script that fixes it when installing the new codebase.The Ninja Space Goat wrote:Magento's codebase is huge and it's riddled with <?=$this?> and <? everywhere. There is no easy way to remove them. Even if there was, you have to do it again every time you update.
I have yet to find any.The Ninja Space Goat wrote:there are most definitely exceptions.
hmm... enable one configuration directive or write an adapter script for an entire codebase... I choose the configuration directive. My client is happy with this choice... saves him a few hundred bucks.There's a simple, easy way. You can easily write an adapter script that fixes it when installing the new codebase.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Keeping short tags won't be supported in PHP 6, so if you ever plan to run on it.. you'll have to convert. Secondly, if you have XML in your files, it will generate parse errors unless you make accommodations. Lastly, it's a vestige from an older time that promotes poor, incompatible code -- because it's an option that can be turned off if a server admin chooses.
- The Phoenix
- Forum Contributor
- Posts: 294
- Joined: Fri Oct 06, 2006 8:12 pm
Magento's codebase is huge and it's riddled with <?=$this?> and <? everywhere. There is no easy way to remove them. Even if there was, you have to do it again every time you update.[/quote]The Ninja Space Goat wrote:In the real world with project deadlines none of these options are practical or realistic.1. modify the code yourself to not use it -- fairly easy.
1. There is a perl one-liner for that. Its search replace from <?=$this to <?php echo $this.
2. Run the script before the update
3. Best - submit the fixes (and it is a fix) upstream to the project. They would likely be extremely appreciative.
Offering a "click and its done" patch to the upstream goes a long way towards getting their help.The Ninja Space Goat wrote:Like you said this can be challenging. Eventually I have a feeling magento will change this, but I wouldn't count on that any time soon.2. push the developer(s) to fix their code -- can be challenging.
Is it possible to turn on short_open_tags per virt host? I suspect it is in .htaccess, which would limit the requirement a bit.The Ninja Space Goat wrote:Find another decent PHP ecommerce app with the features magento has. It is totally worth turning on short_open_tags to get the functionality magento provides.3. use a different codebase that is written correctly -- variable difficulty depending on the niche level of the library in question.
there are most definitely exceptions.
Hm... could you point me somewhere that says that short tags are deprecated and which version of php it's going to happen?
Because here it says that php6 is going to have them:
http://www.php.net/~derick/meeting-note ... dd-php-var
Because here it says that php6 is going to have them:
http://www.php.net/~derick/meeting-note ... dd-php-var