Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 309345

Summary: Use the full PHP open tag <?php not just the <?
Product: Community Reporter: Wayne Beaton <wayne.beaton>
Component: WebsiteAssignee: phoenix.ui <phoenix.ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: denis.roy, info, jasonweathersby, nathan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
URL: http://download.eclipse.org/birt/downloads/
Whiteboard:

Description Wayne Beaton CLA 2010-04-15 12:14:01 EDT
Page is broken

http://download.eclipse.org/birt/downloads/

Looks like you may have some invalid PHP in the body.

Probably could't hurt to have a "Website" component :-)
Comment 1 Jason Weathersby CLA 2010-04-15 12:20:34 EDT
Wayne,

We have not changed these sites lately.  Do you know if anything on the server has changed?

Jason
Comment 2 Wayne Beaton CLA 2010-04-15 12:23:44 EDT
Nathan, can you take a quick look?
Comment 3 Jason Weathersby CLA 2010-04-15 12:39:17 EDT
last november I did copy the Nova theme to here:
/home/data/httpd/download.eclipse.org/birt/downloads/eclipse.org-common/themes/

Those are included in all the php files like:
<?php
	require_once($_SERVER['DOCUMENT_ROOT'] . "/birt/downloads" . "/eclipse.org-common/system/app.class.php");
	require_once($_SERVER['DOCUMENT_ROOT'] . "/birt/downloads" . "/eclipse.org-common/system/nav.class.php");
	require_once($_SERVER['DOCUMENT_ROOT'] . "/birt/downloads" . "/eclipse.org-common/system/menu.class.php");
	require "download.inc";
	
	$App 	= new App();
	$Nav	= new Nav();
	$Menu 	= new Menu();
	include($App->getProjectCommon());

Not certain how this would cause the issue though.
Comment 4 Nathan Gervais CLA 2010-04-15 13:28:09 EDT
I'd recommend you update your eclipse.org-common as a first step.

Then i can take another look at it.
Comment 5 Nathan Gervais CLA 2010-04-15 13:32:02 EDT
Update: Looks like this may be a server config issue with download.eclipse.org
Comment 6 Denis Roy CLA 2010-04-15 13:42:00 EDT
Nova/header.php

The open tag is <?  instead of <?php

On the new download server, I had not enabled short open tags.  I've changed this -- but we should always use <?php to indicate the beginning of script.  Can you fix header.php and check others?
Comment 7 Denis Roy CLA 2010-04-15 13:42:42 EDT
Moving to Phoenix
Comment 8 Jason Weathersby CLA 2010-04-15 13:47:55 EDT
Denis,

Should I change this on the download server?

Jason
Comment 9 Denis Roy CLA 2010-04-15 14:08:35 EDT
> Should I change this on the download server?

Jason, I would simply wait for us (Nathan) to fix the files in the master copy of eclipse.org-common.  You could then simply update your copy in your Birt directory.  That way you get all the updates that Nathan has put in.
Comment 10 Denis Roy CLA 2010-05-20 22:38:18 EDT
Renaming the bug.

We can use <?= $variable ?> in HTML without problems...  But for code blocks we should use <?php ?> for maximum compatibility.

We should do a scan of e.o-c to fix this.
Comment 11 James Whites CLA 2010-05-28 03:14:38 EDT
There are four different pairs of opening and closing tags which can be used in php. Two of those, < ? php ?> and < script language="php"> < /script>, are always available. The other two are short tags and ASP style tags, and can be turned on and off from the php.ini configuration file. As such, while some people find short tags and ASP style tags convenient, they are less portable, and generally not recommended.

In my experience most servers do have short tags enabled. Typing

<?=

is far more convenient than typing

<?php echo

The programmers convenience is an important factor, so why are they not recommended?
Comment 12 Denis Roy CLA 2010-05-28 09:10:53 EDT
James, 

First, I have removed the shameless plug to your term papers website.  It is not appropriate here, and I'm frankly bored with all the SPAM for term paper websites I've been removing lately -- mostly on our Wiki.

Second, your experience may be a bit lacking, since most Entreprise distros disable PHP short_open_tags by default.  Additionally, short_open_tags is disabled by default in PHP 5.3+, and it's possible it may be deprecated for php 6.0.
Comment 13 Denis Roy CLA 2010-06-17 13:55:38 EDT
We have thousands of hits for this on www.eclipse.org, so we're likely stuck with the short open tags for a while.  Let's just agree to use the long form when developing new pages.