User login

Getting trained by Eclipse PDT: Opening an existing folder of files as a project

So you have a directory structure of a project, say it's a giant site you're taking over, and you want to open it as a project in Eclipse PHP Development Tools (PDT) to be able to use the project-wide search and other cool tools.

I just spent an hour trying to do it through File » New PHP Project and then naming the existing spot in the file system for the folder with all the code. This did not work. It completed without error, but if it were even creating the project I have no idea where it was putting them.

Creating a project in the default location did work.

File » New PHP Project with "Use defaults" under project contents.

Then, as a second step:

File » Import and under "General" select "File System". Let it grab your folder full of files (and subdirectories etc) wherever it is on your computer, and import it into your project at the default location.

Classify this as a workaround rather than actually knowing how it should work. But hey, at least it works. Humor Eclipse PDT; it will usually be worth it.

Resolution

Searched words: 
Eclipse PDT new PHP project from directory import project from source use existing code for PDT project

Comments

The way to do this is

The way to do this is explained on this page:

http://www.cotonti.com/page.php?al=eclipse_pdt_howto

It says:

To import an existing project on your hard disk to Eclipse, do the following:
a. Copy .project file into the root of your project folder from some existing project. Edit this file and set new project name.
b. Open Eclipse and run File => Import => General => Existing Project into Workspace.
c. Locate your project on hard disk, make sure it appears in "Projects" combo and hit "Finish".

In other words, you copy the ".project" file from the folder of existing project (you can make a new project in Eclipse just to generate the .project file to copy), copy it into the folder where your existing files are, open the .project file (in notepad etc) and change the value in ... to the name you want to use for the project. Then you can import it properly in Eclipse.

You also need to copy the

You also need to copy the file ".buildpath" for the PHP Functions panel to work correctly.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.