FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17305&edit=1

ID: 17305
Updated by: ken@linux.ie
Reported By: ken at linux dot ie
Summary: No checking to see if a data file exists - bad error
handing
Status: Open
Type: Bug
Package: Image_GIS
Package Version: SVN
PHP Version: 5.2.6
-Assigned To:
+Assigned To: kguest
Roadmap Versions:
New Comment:

-Assigned To:
+Assigned To: kguest



Previous Comments:
------------------------------------------------------------------------

[2010-04-11 10:12:03] kguest

Description:
------------
If you add a datafile that doesn't exist, eg spelling mistake etc:
Warning: Invalid argument supplied for foreach() in
/usr/share/php/Image/GIS/Renderer.php on line 215


Test script:
---------------
<?php
require_once 'Image/GIS.php';

$map = new Image_GIS( array( 'width' => 960, 'height' => 1280, 'range'
=> array( 'x1' => 9.7, 'x2' => 10.5, 'y1' => 54.2, 'y2' => 54.7 ) ) );
// Political
$map->addDataFile('germany_ponet.e00', 'black');
// Roads
$map->addDataFile('germany_rdline.e00', 'gray');
// Drainage
$map->addDataFile('germany_utline-not-existing.e00', 'green');
$map->saveImage('kiel.png');

?>


Expected result:
----------------
an error message to be displayed re "germany_utline-not-existing.e00"

Actual result:
--------------
[kguest@radagast trunk]$ php test_bad_datafile.php

Warning: Invalid argument supplied for foreach() in
/usr/share/php/Image/GIS/Renderer.php on line 215

Call Stack:
0.0002 70512 1. {main}()
/home/kguest/dev/pear/pear/Image_GIS/trunk/test_bad_datafile.php:0
0.0080 535692 2. Image_GIS->saveImage()
/home/kguest/dev/pear/pear/Image_GIS/trunk/test_9545.php:15
0.0080 535692 3. Image_GIS->render()
/usr/share/php/Image/GIS.php:170
1.6374 25595288 4. Image_GIS_Renderer->render()
/usr/share/php/Image/GIS.php:159

[kguest@radagast trunk]$

------------------------------------------------------------------------

Search Discussions

  • Ken at Apr 11, 2010 at 9:24 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17305&edit=1

    ID: 17305
    Updated by: ken@linux.ie
    Reported By: ken at linux dot ie
    Summary: No checking to see if a data file exists - bad error
    handing
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: Image_GIS
    Package Version: SVN
    PHP Version: 5.2.6
    Assigned To: kguest
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Closed
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on
    pear.php.net by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.




    Previous Comments:
    ------------------------------------------------------------------------

    [2010-04-11 10:17:54] kguest

    Added #patch bug:17305;patch:CheckDataFileExists;revision:1270981074;.

    ------------------------------------------------------------------------

    [2010-04-11 10:12:11] kguest

    -Assigned To:
    +Assigned To: kguest


    ------------------------------------------------------------------------

    [2010-04-11 10:12:03] kguest

    Description:
    ------------
    If you add a datafile that doesn't exist, eg spelling mistake etc:
    Warning: Invalid argument supplied for foreach() in
    /usr/share/php/Image/GIS/Renderer.php on line 215


    Test script:
    ---------------
    <?php
    require_once 'Image/GIS.php';

    $map = new Image_GIS( array( 'width' => 960, 'height' => 1280, 'range'
    => array( 'x1' => 9.7, 'x2' => 10.5, 'y1' => 54.2, 'y2' => 54.7 ) ) );
    // Political
    $map->addDataFile('germany_ponet.e00', 'black');
    // Roads
    $map->addDataFile('germany_rdline.e00', 'gray');
    // Drainage
    $map->addDataFile('germany_utline-not-existing.e00', 'green');
    $map->saveImage('kiel.png');

    ?>


    Expected result:
    ----------------
    an error message to be displayed re "germany_utline-not-existing.e00"

    Actual result:
    --------------
    [kguest@radagast trunk]$ php test_bad_datafile.php

    Warning: Invalid argument supplied for foreach() in
    /usr/share/php/Image/GIS/Renderer.php on line 215

    Call Stack:
    0.0002 70512 1. {main}()
    /home/kguest/dev/pear/pear/Image_GIS/trunk/test_bad_datafile.php:0
    0.0080 535692 2. Image_GIS->saveImage()
    /home/kguest/dev/pear/pear/Image_GIS/trunk/test_9545.php:15
    0.0080 535692 3. Image_GIS->render()
    /usr/share/php/Image/GIS.php:170
    1.6374 25595288 4. Image_GIS_Renderer->render()
    /usr/share/php/Image/GIS.php:159

    [kguest@radagast trunk]$

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedApr 11, '10 at 9:17a
activeApr 11, '10 at 9:24a
posts2
users1
websitepear.php.net

1 user in discussion

Ken: 2 posts

People

Translate

site design / logo © 2022 Grokbase