Menu

#16 defaults.php has no effect

phpweather-2.x
closed
nobody
7
2003-09-02
2003-03-11
Loic RIOUAL
No

Hi, I just discovered php weather, this is great !
And I am really admirative using this tool, it is such well
developped !
I am using the latest version 2.1.1 downloaded today.

Anyway, when creating my defaults.php via your
interface, and puting it in the root dir, this has no effect,
my page doesn't take this in consideration.
I just made a test to see if the include was done but
that's it.

Voila !

Merci.

Loďc

Discussion

  • Anonymous

    Anonymous - 2003-04-20

    Logged In: YES
    user_id=104098

    Hmm, it works here. Have you uploaded defaults.php to the
    same directory as PHP Weather?

     
  • Anonymous

    Anonymous - 2003-04-20
    • priority: 5 --> 4
     
  • Guillaume

    Guillaume - 2003-08-16

    Logged In: YES
    user_id=277619

    I have the same problem here..

    stereo@Hertz:~/public_html/phpweather-2.1.2/ > ls -l
    defaults.php
    -rw-r--r-- 1 stereo stereo 176 Aug 16 09:16 defaults.php

    The file doesn't even seem to be read by base_object.php. I added
    echo "foo"; to defaults.php and didn't find anything in the output.

    PHPWEATHER_BASE_DIR seems to be correct (/home/stereo/
    public_html/phpweather-2.1.2). base.object.php sees the file; I
    added another echo foo; after
    "if(file_exists(PHPWEATHER_BASE_DIR . '/defaults.php')) {" and it
    is printed twice.

    This is my defaults.php:

    <?php
    /* This is a local configuration file for PHP Weather.
    /* icao */
    $this->properties['icao']='ELLX';

    /* pref_units */
    $this->properties['pref_units']='only_metric';

    ?>

     
  • Anonymous

    Anonymous - 2003-08-16

    Logged In: YES
    user_id=104098

    This is very weird for your setup looks fine. I've just
    downloaded phpweather-2.1.2.tar.bz2, unpacked it and made a
    defaults.php file with

    <?php
    $this->properties['pref_units'] = 'only_metric'; /*
    locale_common.php */
    ?>

    This works as expected which means that the weather report
    on the index.php page now only contains metric units.

    I'm using PHP 4.3.3RC3 on a Debian GNU/Linux system with
    Apache 1.3.27. What versions are you using? (Use the
    phpinfo() function in PHP to find out if you're unsure.)

     
  • Anonymous

    Anonymous - 2003-08-16
    • priority: 4 --> 7
     
  • Max Hammond

    Max Hammond - 2003-08-16

    Logged In: YES
    user_id=81516

    A couple of things to try:

    i) replace PHPWEATHER_BASE_DIR with the full path. I had
    some trouble with that on solaris but haven't had time
    recently to work out what was happening. I know it sees the
    file, but you it's perhaps not including it :-P

    ii) get rid of the conditional if{}, and change the
    include() for require(). That'll at least make it tell you
    why it can't get hold of a file. You could also turn up your
    error reporting level - that should help work out what's up.

     
  • Guillaume

    Guillaume - 2003-09-02

    Logged In: YES
    user_id=277619

    Please ignore my previous comment, I am an idiot who can't even
    type "defaults" correctly :).

     
  • Anonymous

    Anonymous - 2003-09-02

    Logged In: YES
    user_id=104098

    So can I conclude that this works correctly in PhpWeather?
    Or are people still having problems?

     
  • Anonymous

    Anonymous - 2003-09-02
    • status: open --> closed
     

Log in to post a comment.