1

Re: php 5.3.3 and indicia 0.4

Hi,
I've been trying to install the indicia 0.4 warehouse on my local machine. However, on the configuration check page I get an error saying that dbase support isn't installed. The advice is to edit php.ini and enable extension php_dbase.dll
Unfortunately, that extension does not exist in my ext folder. There isn't much to google, but it appears that the extension has been dropped from the default installation of PHP. I wasn't able to find a version compatible with 5.3 either. Any workarounds for this? I assume this would be required for use with shapefiles?

In the meantime, I'm using indicia 0.3 since this at least gets me past the config check.

p.s. in the online setup guid the link to download indicia points to version 0.2, which does not work (you cannot login) as discussed here:
http://forums.nbn.org.uk/viewtopic.php?id=1257

Cheers,
andyb

2

Re: php 5.3.3 and indicia 0.4

Hi Andy
If you use version 0.3, then upgrade to 0.4 by copying the files over then accessing the upgrade link you will get on the Warehouse home page, it will get you round this problem. DBase support is indeed required for SHP file upload support, but it ought to be optional and just a warning rather than an error. I will look into it, both from the point of view of changing the installer and also working out a better alternative for PHP to dBase. See http://bugs.php.net/bug.php?id=49138.

I've fixed the link on the install guide - thanks for pointing that out.
Best Wishes

John van Breda
Biodiverse IT

3

Re: php 5.3.3 and indicia 0.4

Andy, a quick fix for this to install 0.4. Locate the file modules/indicia_setup/helpers/config_test.php. Open it in a text editor, then locate the function check_dBase. Replace this entire function with the following:

private static function check_dBase(&$messages, $problems_only) {
    if (!function_exists('dbase_open')) {
      // Note that this does NOT prevent installation, only give a warning.
      array_push($messages, array(
        'title' => 'dBase Library',
        'description' => '<p>The dBase library is not installed on this web server. This is required to enable upload of SHP files containing location boundaries, but '.
            'does not stop Indicia working. To fix this for servers running PHP 5.2, find your php.ini file in the PHP installation folder and ' .
            'find the line <strong>;extension=php_dbase.dll</strong>. Remove the semi-colon from the start of the line and save the file, then restart your ' .
            'webserver process. If you compiled PHP yourself, you must compile PHP with dbase support by using the --enable-dbase configuration option.</p>',
        'success' => true
      ));
    } elseif (!$problems_only) {
      array_push($messages, array(
        'title' => 'dBase Library',
        'description' => '<p>The dBase library is installed.</p>',
        'success' => true
      ));
    }
  }
John van Breda
Biodiverse IT

4

Re: php 5.3.3 and indicia 0.4

Hi John,

I managed to get both warehouse and client websites up and running on my local machine yesterday, using indicia version 0.3. I used the example form given in the googlecode wiki. Indicia looks very promising functionally and pretty straightforward to use (the helpers are great). After a couple of false starts, it was very satisfying to edit a record on the website and see the tables updated in the postgres database!

Thanks for your suggestions about getting 0.4 to work with the latest version of PHP. I'll try them this week. It looks like the dbase extension can still be downloaded and compiled from the repository e.g.
http://www.issociate.de/board/post/497654/dbase_extension_for_PHP_5.3.0.html
and
http://www.pear-forum.org/topic2314.html
So perhaps the long term solution will be to redistribute the package or include instructions on how to download it when that is sorted out?

When Jo Purdy tried using the helpers, she hit a problem with the survey list in the example code (somewhere in this thread):
http://forums.nbn.org.uk/viewtopic.php?id=1211
I found that my surveys didn't appear too.
This was solved by editing the call to data_entry_helper::select
and adding the website id to extraparams
'extraParams'=>$readAuth + array('website_id' => 'My ID')
Didn't look into this any further but, presumably, website_id should live somewhere in $readAuth?
I also found that deleted surveys appeared in my select (but not in the warehouse admin pages). I guess this needs an additional where clause in the query that populates the list?

Anyway, it was a good experience overall and feels 'right' in terms of the level of abstraction. I'm looking forward to exploring the whole range of functionality further.

Cheers,
andyb

5

Re: php 5.3.3 and indicia 0.4

Hi Andy
I have a working select control, on the basic_data_entry_tutorial page. It populates with the list of surveys fine, even though $readAuth contains a nonce and auth_token but nothing else. The code is:

echo data_entry_helper::select(array(
    'label'=>'Survey',
    'fieldname'=>'sample:survey_id',
    'table'=>'survey',
    'captionField'=>'title',
    'valueField'=>'id',
    'extraParams' => $readAuth
));

I couldn't spot where Jo had the same problem in the other thread.

Regarding the deleted surveys, actually I think the view itself needs a correction to filter out deleted data. I'll post an issue on the issue tracker to make sure this is not forgotten.

Best Wishes

John van Breda
Biodiverse IT