Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Eclipse Php : variable undefined evenif it is defined in an require_once php file
Eclipse Php : variable undefined evenif it is defined in an require_once php file [message #1791607] Mon, 02 July 2018 19:40 Go to next message
Stéphane Bertho is currently offline Stéphane BerthoFriend
Messages: 3
Registered: July 2018
Junior Member

1
down vote
favorite
I am using as a beginner : Eclipse IDE for PHP Developers Version: Photon Release (4.8.0) Build id: 20180619-1200 OS: Windows 10, v.10.0, x86_64 / win32 Java version: 1.8.0_77

I have a file index.php with a require_once(initialisation.php) The initialisation.php defines a variable $Modeles_Chemin And the variable $Modeles_Chemin is used in index.php (after the require_once)

On my website, it works fine no undefined variable but in eclipse editor I receive an undefined variable.

(Of course I have the same problem with the other variables).

Here is an extract : index.php :
<?php
require_once("prog/php/initialisation_site.php");
include($Modeles_Chemin.$Modeles_Nom."/html_begin.php");

initialisation_site.php :
$Contenu_Chemin = "contenu/";
$Modeles_Chemin = $Contenu_Chemin."modeles/";


How can I fix this ?

thanks
Re: Eclipse Php : variable undefined evenif it is defined in an require_once php file [message #1791929 is a reply to message #1791607] Sat, 07 July 2018 18:28 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 290
Registered: March 2013
Senior Member
PDT currently doesn't follow/validate require/include.

Re: Eclipse Php : variable undefined evenif it is defined in an require_once php file [message #1791943 is a reply to message #1791929] Sun, 08 July 2018 16:58 Go to previous messageGo to next message
Stéphane Bertho is currently offline Stéphane BerthoFriend
Messages: 3
Registered: July 2018
Junior Member
Hi
thanks for the answer. Is there any plugin available to do that ?
Re: Eclipse Php : variable undefined evenif it is defined in an require_once php file [message #1791984 is a reply to message #1791943] Mon, 09 July 2018 09:57 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 290
Registered: March 2013
Senior Member
As far as I know no. This feature was moved from plugin to PDT in 6.0 phase. You can:
1. Disable this validator completely
2. Create /** @var Type $variable */ comments in index.php

I think we will add ability to disable file validation only.


Re: Undefined/unused php variables not showing as a warning on latest Eclipse version (09-2018)) [message #1798035 is a reply to message #1791984] Sun, 11 November 2018 11:07 Go to previous messageGo to next message
Irfan Ahmad is currently offline Irfan AhmadFriend
Messages: 1
Registered: November 2018
Junior Member
Hello team,
Greetings

Please help me to resolve this issue:
Undefined php variable not showing as a warning on latest eclipse version (09-2018), can someone tell me why it is happend & how can i show the warnings?
Please check the screenshots for more details:
If possible plz give me brief details regarding this.


Thankyou
Re: Eclipse Php : variable undefined evenif it is defined in an require_once php file [message #1798876 is a reply to message #1791984] Mon, 26 November 2018 22:16 Go to previous message
Zrin Ziborski is currently offline Zrin ZiborskiFriend
Messages: 4
Registered: November 2018
Junior Member
Quote:
I think we will add ability to disable file validation only.

It'll be much more helpful to allow to switch the warning off for a variable with a hint in a comment. Something like /** global_var($something) **/
Or perhaps to turn off the warning for global (top level) variables.
Previous Topic:Eclipse PHP IDE installation issue
Next Topic:Newbie needs help with PDT 3.2.0/XDebug/Chrome
Goto Forum:
  


Current Time: Thu Apr 25 20:44:39 GMT 2024

Powered by FUDForum. Page generated in 0.05696 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top