Re: GladeXML and relative path
| From: | Frank M. Kromann | Date: | Sat, 17 Nov 2001 19:50:35 +0000 |
| Subject: | Re: GladeXML and relative path | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-604@lists.php.net to get a copy of this message | ||
Current working directory is always the active directory when php.exe (or php_win.exe) is loaded.
There is two ways to "fix" this problem.
1) add c:\php-gtk to your system path and execute the script from the directory where it is located.
2) execute the script from the location with c:\php-gtk\php -q <script name>
I like option 2 the most. That way I can have more than one php installation on my system.
Remember if you create shortcuts to php/php-gtk applications you should alwasy specify the full path
to php.exe and set the working directory to the location of the script.
- Frank
> Seems to be a win32 problem only. Some testing showed that
> c-system function 'getcwd()' spits out the directory of the
> script under linux but the directory from the shell prompt under
> win32.
>
> Frank, any idea?
>
> On Sat, Nov 17, 2001 at 05:14:32PM +0100, Urs Gehrig wrote :
> > dear all
> >
> > while trying to load a glade file it occurred, that it would work under the
> > condition:
> >
> > a)
> > c:\php-gtk\php.exe
> > c:\php-gtk\gtk-glade.php
> > $g = &new GladeXML("dialog.glade"); // line within gtk-glade.php
> > c:\php-gtk\dialog.glade
> >
> > c:\php-gtk\>php -q gtk-glade.php
> >
> > but it did not work under the condition, that the glade file is in any other
> > location than the dialog.glade file, like:
> >
> > b)
> > c:\php-gtk\php.exe
> > c:\php-gtk\projects\glade\gtk-glade.php
> > $g = &new GladeXML("dialog.glade"); // line within gtk-glade.php
> > or
> > $g = &new GladeXML("./dialog.glade"); // line within gtk-glade.php
> > c:\php-gtk\projects\glade\dialog.glade
> >
> > C:\PHP-GTK>php -q C:\PHP-GTK\projects\glade\gtk-glade.php
> > ----> produces: warning: failed to load external entity "./dialog.glade"
> >
> > so, actually i would have expected, that the glade file would be found, if
> > it is in the same directory as the gtk-glade.php file itself. but this does
> > not seem to work. maybe i am wrong. but at least, this would be the way, i
> > intuitively would call the glade file.
> >
> > well, that would not be that much a problem, if i could use something like
> > $GLOBALS[PATH_TRANSLATED] to point for the glade file. but since this is not
> > online-called file but calle through command line, PATH_TRANSLATED does not
> > seam to be defined at all.
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-gtk-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>