Hi Guys,

a small recommendation: I think you should place a note in the documentation (and on the project homepage) that this module requires php 5. I know that skilled developers should check that (and have access to php 5 regardless) but it did take me an hour or two of exploring to figure this out. It could save people in the future.

Just a thought.

Thanks for the awesome toolset!

Comments

zzolo’s picture

Title: PHP 5 » Change Info File for PHP 5 Depdendency
Category: task » bug

Hey, I'm curious as to what specific functions or calls make this dependent on PHP 5, apt94jesse.

Changing title and category.

apt94jesse’s picture

Ha, well, I didn't look at that specifically. I just know that I got all sorts of errors and alerts when I had it on my php 4 server. When I installed the module on a drupal site that was on a server with php 5, everything was hunky dory.

Looking back at the older installation (older as in last week), I received the following error when trying to add a preset:

Parse error: syntax error, unexpected '=', expecting ')' in /home/ ... /modules/openlayers/includes/openlayers.render.inc on line 23

Line 23 contains the following

function _openlayers_layers_process($layers = array(), &$map = array()) {

I know JUST enough php to muck around in there, and I know that the "&$map" looks a little fishy for what I'm used to. I've never seen a & in front of a variable before, though obviously it's a legit use since the module works great on php 5. Taking the & out there and on several subsequent lines got rid of the error, however the module never worked on the php 4 server.

There was also a very generic error in the views style plugin. Whenever I selected 'openlayer' as the style for a view, I got a popup alert saying "An error occurred at url/admin/build/views/ajax/display/adsf/default/style_plugin."

SO, my assumption was that these were caused by php version issues.

phayes’s picture

I've made openlayers require php 5.2: http://drupal.org/cvs?commit=268582 and http://drupal.org/cvs?commit=268590

Why PHP 5.2 and not 5.1? Well, according to the GoPHP5 project (http://gophp5.org/):

PHP 5.0.x had a number of problems with stability and performance. Much of the feature set wasn't fully nailed down yet either, and tools such as SPL and PDO didn't work right until PHP 5.1. Many developers and web hosts shied away from PHP 5 because of it's unfortunately rocky beginnings. Fortunately, PHP 5.0 is not very widely used.

PHP 5.1 was much more stable and reliable, but it also had some issues with performance. It's a viable platform, however, and many projects already require it.

PHP 5 has really come into its own with PHP 5.2, however. It adds a number of important features to the core system that we feel are important to target. Most importantly:

  • The Filter extension is a new security component in PHP. Although available as an optional add-on in PHP 5.1, most web hosts did not install it. It is, however, now included by default in PHP 5.2. The filter extension allows developers to read input more safely and securely. That helps make programs more secure, less error prone, and harder to hack.
  • Many sites now use Ajax for much of their functionality, and one of the most popular tools for Ajax is the JSON format. JSON is a way of specifying data that both Javascript in the web browser and PHP or other languages on the server can understand, making writing portable Ajax applications easier. PHP 5.2 includes a fast, native mechanism for reading and writing from JSON, just as it does for XML, which makes writing dynamic rich client applications easier.
  • Faster, more stable, fewer bugs!
phayes’s picture

Status: Active » Needs review

I'f you guys are ok with 5.2 instead of 5.1 please mark as fixed.

apt94jesse’s picture

Status: Needs review » Fixed

That all looks good to me. I would recommend there be a small note on the project page similar to other modules that have php version requirements, but that's an opinion and not, in my mind, a necessity.

Otherwise, I'm marking as "Fixed" since there's at least a short discussion now in case people search the issues as I did :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.