[ phpeclipse-Bugs-1085923 ] server variables not available in class constructors

"SourceForge.net" <[email protected]> Thu, 10 May 2007 23:54:34 -0700
Newsgroups gmane.comp.ide.eclipse.phpeclipse.devel
Message-ID <[email protected]>
Bugs item #1085923, was opened at 2004-12-15 15:30
Message generated for change (Settings changed) made by scorphus
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1085923&group_id=57621

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Pablo Aguiar (scorphus)
Summary: server variables not available in class constructors

Initial Comment:
in both modes: "run" and "debug" some server variables 
(e.g. $_SERVER["DOCUMENT_ROOT"]) are not available 
in the constructor of a PHP-Class. Example below:

"Main"-Script:

<?php
/*
 * Created on 14.12.2004
 *
 * To change  th e template for this generated file go to 
Window - Preferences
 * - PHPec lipse - gPHP - Code Templates
 */
 
 include_once("test.inc");
 
 $teste = new Hello();
 $teste->DoIt();
 
?>

"Test.inc"

class Hello
{

  function __construct()
  {
     // not all server-variables available
     var_dump($_SERVER);
  }

  function DoIt()
  {
     // all server-variables available
     var_dump($_SERVER);
  }
}
?>

This issue is reproducable with php 4.3.8 and php 5, 
both on a windows xp system with a apache 2.0.48, 
with the latest phpeclipse (released 4-12-2004)

could you please check this,

thank you 

Ronden

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

Comment By: Gullivero (gullivero)
Date: 2004-12-16 20:59

Message:
Logged In: YES 
user_id=1179188

that's right, phpeclipse calles the php binary directly, but
there is a server/documentroot mapping property in the
project properties. plus as I described, the variables are
only missing in the constructor of a php class. they are all
available within other methods than the constructor and also
in "regular-non-oo" script-parts.
the whole run/debug thing wouldn't be that great if there
were no access to the server environment. I think most
php-applications do use these variables,

kind regards,

gullivero

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

Comment By: Rainer Müller (raimue)
Date: 2004-12-16 16:06

Message:
Logged In: YES 
user_id=970766

That's a normal behavior. Where should the $_SERVER vars
come from? PHPEclipse calls the PHP binary directly AFAIK,
so there is no server.

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

Comment By: Gullivero (gullivero)
Date: 2004-12-15 21:13

Message:
Logged In: YES 
user_id=1179188

Hi,

I don't think this is a php issue. 
when I call the script over a browser, the problem does not
occur. also, the script runs perfectly, when the eclipse
internal browser is running the script after I made changes
and saved it. 
But executing it, by using the "run" or "debug" option of
phpeclipse, the problem appears as described. 

kind regards

Gullivero

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

Comment By: Rainer Müller (raimue)
Date: 2004-12-15 17:50

Message:
Logged In: YES 
user_id=970766

Are you talking about an iusse in PHP? Then you should
report it at bugs.php.net or discuss it on the php-devel
mailing list but not here.
Otherwise I don't understand how this is related to PHPEclipse.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1085923&group_id=57621

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Phpeclipse-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpeclipse-devel