Elliot,<br><br>Here is a better explanation of how I structure my code. In the eclipse project I wanted to set projectname as the root directory.<br><br>Now projectname/htdocs is the webroot. Every single file in htdocs includes a file called
config.inc.php. The file includes this code:<br><br>if(preg_match("/WINDOWS/i", $_SERVER["SystemRoot"]))<br>{<br> // THIS IS A WINDOWS MACHINE<br><br> ## Include paths<br> $_PATHS["base"] = dirname(dirname(__FILE__)) . "\\";
<br> $_PATHS["includes"] = $_PATHS["base"] . "includes\\";<br> $_PATHS["templates"] = $_PATHS["base"] . "templates\\";<br> $_PATHS["pear"] = $_PATHS["base"] . "pear\\";
<br> $_PATHS["logs"] = $_PATHS["base"] . "logs\\";<br> $_PATHS["sidebar"] = $_PATHS["base"] . "sidebar\\";<br><br> /**<br> * Set include path
<br> */<br> ini_set("include_path",<br> ".;$_PATHS[includes];$_PATHS[templates];$_PATHS[pear];$_PATHS[sidebar]");<br><br>}else{<br> // NOT A WINDOWS MACHINE (Linux, Mac, FreeBSD)<br>
<br> ## Include paths<br> $_PATHS["base"] = dirname(dirname(__FILE__)) . "/";<br> $_PATHS["includes"] = $_PATHS["base"] . "includes/";<br> $_PATHS["templates"] = $_PATHS["base"] . "templates/";
<br> $_PATHS["pear"] = $_PATHS["base"] . "pear/";<br> $_PATHS["logs"] = $_PATHS["base"] . "logs/";<br> $_PATHS["sidebar"] = $_PATHS["base"] . "sidebar/";
<br><br> /**<br> * Set include path<br> */<br> ini_set("include_path",<br> ".:$_PATHS[includes]:$_PATHS[templates]:$_PATHS[pear]:$_PATHS[logs]:$_PATHS[sidebar]");<br>}<br><br>this lovely bit of code means that I don't have to type:
<br><br>include_once("../includes/functions.php");<br><br>I can just do this instead:<br><br>include_once("functions.php");<br><br>Unfortunately eclipse does not seem to enjoy this style of structuring which is a shame because I find it highly effective.
<br><br>I shall have to look into your suggestion of using a problems filter, that sounds promising.<br><br>Pete<br><br><br><br><div><span class="gmail_quote">On 4/26/06, <b class="gmail_sendername">Elliot Smith</b> <<a href="mailto:elliot@townx.org">
elliot@townx.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dear Pete,<br><br>Although I don't organise my code like this, from what I know of
<br>PHPEclipse, it should resolve paths correctly if you did your includes<br>something like this (presuming you set projectname as the root directory<br>when creating your Eclipse project):<br><br>require_once('../includes/file.php');
<br><br>I assume you're doing something like this, rather than using absolute<br>paths? Another approach may be to just exclude those messages from the<br>problems list using a filter.<br><br>Elliot<br><br><br>pete graham wrote:
<br><br>> I have been experimenting with PHPeclipse yesterday and today. Here is<br>> a fairly big problem that I have run into that has stopped me from<br>> using it.<br>><br>> Eclipse generates a lot of warnings of type: "Include filename
<br>> 'blah.php' doesn't exist in project."<br>><br>> I tried to explicitly set the "Include Path" for the project in<br>> "Project->Properties->PHP Project Settings->Include Paths" (although
<br>> this shouldn't be necessary because these paths are dynamically set by<br>> a set_include_path() call in the script). This hasn't solved the problem.<br>><br>> All my projects have this structure<br>>
<br>> projectname/htdocs/ # actual website root<br>> projectname/includes/ # mostly php classes and files<br>> with programming logic<br>> projectname/templates/ # html files, headers footers, etc
<br>><br>> I find this an effective way of organising the files. It seems the<br>> only way to get PHPeclipse to not generate the errors is to place all<br>> code in the website root which I really don't want to do. Can anyone
<br>> help me on this problem?<br>><br>> I saw on a forum post that "working sets" may be able to solve my<br>> problem, but I'm quite unclear on what these are.<br>><br>> Pete<br>><br>>------------------------------------------------------------------------
<br>><br>>_______________________________________________<br>>Phpwm mailing list<br>><a href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a><br>><a href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">
https://mailman.lug.org.uk/mailman/listinfo/phpwm</a><br>><br>><br><br><br>_______________________________________________<br>Phpwm mailing list<br><a href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
<br><a href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a><br></blockquote></div><br>