This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219236 - PHP - Can not add a source directory to the include path
Summary: PHP - Can not add a source directory to the include path
Status: RESOLVED INVALID
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-30 22:47 UTC by deliank
Modified: 2012-11-30 08:08 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (49.56 KB, text/plain)
2012-09-30 22:47 UTC, deliank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description deliank 2012-09-30 22:47:09 UTC
I have the following project structure:

root
  WEB
    app1
  lib
    app1
      model
      view
      controller

The NetBeans project is pointed to the root directory.
The web server points to WEB.

The problem is that I can not add 'lib' to the project 'Include path'.
Netbeans complains with:

  Path 'XXX/lib' is already part of project.

This was possible with versions of NetBeans prior to 7.2 .

It is annoying because the auto-complete does not work for files in lib. E.g.

require 'app1/controller/MyController.php';

and you all know how convenient the auto-complete is :-)


Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Linux version 3.2.0-3-686-pae running on i386
Java; VM; Vendor = 1.7.0_03
Runtime = OpenJDK Client VM 22.0-b10
Comment 1 deliank 2012-09-30 22:47:15 UTC
Created attachment 125125 [details]
IDE log
Comment 2 Tomas Mysik 2012-10-02 11:40:48 UTC
FYI The NetBeans' complain is correct - if the "root" folder is your Source Files folder then all subdirectories are automatically parsed by NetBeans.

(In reply to comment #0)
>   Path 'XXX/lib' is already part of project.

As I wrote above, that is true.

> This was possible with versions of NetBeans prior to 7.2 .

That was a bug.

> It is annoying because the auto-complete does not work for files in lib. E.g.
> 
> require 'app1/controller/MyController.php';

So, the code completion does not work for the filesystem paths? Or the code completion does not work for the MyController fields and methods?

Please reopen this issue and tell us.

Thanks.
Comment 3 ianfp 2012-10-31 03:46:35 UTC
Here is what's happening to me. I have a Symfony2 project with the following directory structure:

root/
  src/  # my source code
  web/  # document root
  ...
  vendor/  # third party software

My source folder is root/, but I have added vendor/ to the ignored folders list, for two reasons:

1) I don't want results from vendor/ to come up when I do a search or open.
2) vendor/ is very large and Netbeans will never stop scanning if it is included.

But, I do want code-completion for the libraries in vendor/. Now that is no longer possible.
Comment 4 Tomas Mysik 2012-10-31 08:32:08 UTC
Ignored folders means that these folders are:
- not visible in Projects view,
- ignored by the editor (not scanned but also not offered in code completion etc.).

Thanks for reporting.
Comment 5 ianfp 2012-10-31 15:52:41 UTC
I've logged a new enhancement request to deal with the issue I'm having:

http://netbeans.org/bugzilla/show_bug.cgi?id=221193
Comment 6 altermine 2012-11-27 02:53:33 UTC
The case in the original report is non-obvious, though perfectly valid.

There is much more simple scenario — consider the following project structure:

root/
  lib/
    library.php
  controller/
    about.php
  front.php
  

Before Netbeans 7.2 I added root folder to include path and could use include '' and include_once '' path completion for lib/* not only in my front.php, but in lib/library.php and controller/about.php also. Now this is impossible. Also I can't Ctrl+click on file path in my controller/about.php:
  include 'lib/library.php';

Fortunately, editing include.path in project.properties still works perfectly, which is a workaround.
Comment 7 Tomas Mysik 2012-11-30 08:08:20 UTC
(In reply to comment #6)
> The case in the original report is non-obvious, though perfectly valid.
> 
> There is much more simple scenario — consider the following project structure:
> 
> root/
>   lib/
>     library.php
>   controller/
>     about.php
>   front.php
> 
> 
> Before Netbeans 7.2 I added root folder to include path and could use include
> '' and include_once '' path completion for lib/* not only in my front.php, but
> in lib/library.php and controller/about.php also. Now this is impossible. Also
> I can't Ctrl+click on file path in my controller/about.php:
>   include 'lib/library.php';

Just tried it in the development version of NetBeans and it works as expected - you can complete any path from your project (sorry, it does not make sense to put your project files to the include path of the same project; this already NetBeans does, in fact).

From the reason above, closing back as INVALID. Please reopen and attach a sample project where Source Files are not on Include Path and any code completion for any project file does not work.

Thanks for reporting.

Product Version: NetBeans IDE Dev (Build 20121129-e683c348b155)
Java: 1.6.0_37; Java HotSpot(TM) 64-Bit Server VM 20.12-b01
Runtime: Java(TM) SE Runtime Environment 1.6.0_37-b06
System: Linux version 3.5.0-18-generic running on amd64; UTF-8; cs_CZ (nb)