Netbeans: Creating a Project Concept versus Opening Files - php

I'm having a little trouble understanding a couple of concepts.
I am new to Netbeans and using it for PHP development. I am previously using JEdit. In JEdit, I just simply open the file browser and start editing files.
In Netbeans, it wants me to create projects and import files.
My questions are:
When I import a project, it sets up data files that Netbeans needs and leaves the original directory in tact, correct? I noticed I could open and edit a project and it affected the original.
Sometimes I like to quickly switch between projects and just want to view the /www/ directory of my wamp server to grab files, look at past projects, etc. Why can't I simply do this? (must I always import projects to see my /www/ folder)
What is the point between creating a project versus just opening files?
Thanks all!

The point of creating a project vs just opening files in an editor is that Netbeans knows that all these files go together. They are part of the same project. That allows you, for instance, to refactor function names or class names and have Netbeans automatically apply the changes everywhere those are used within your project.
If you create a project from existing sources, those existing files will be the ones you're editing. If you have your files under version control, you can simply create a Netbeans project in the directory where you checked out your code. You can then do commits and all from within Netbeans.

Related

Use PHPDocumentor to create an Eclipse Library

I have an unusual request,
I'm working on PHP 5.3, my IDE is Eclipse and I need help setting a file like the one that comes in default with the php functions, so I can use it for code completion and I can have the documentation on hover.
So basically, I have a library, which I want to pull the declarations for everything (function, classes, etc) and the PHPDoc block, and use them to create a new file, which will be added as a library on Eclipse on the include path. Anyone knows an automatic way to do it?
EDIT: To explain a bit better what I want to do. I want to run a script that will do almost what PHPDoc does, but instead of creating a set of html files after load a file, it will create a copy of the php file which only has the declarations and comments. So that file can be given to the programmers, instead of the full library with source-code.
I though about using the ReflecationClass, by including each file, check the defined class\functions and then writing the new file, but that means that all the includes\requires need to happen in order, something I can't guarantee
Not sure if this counts as "automatic", but what you describe sounds like it can be roughly accomplished by having this library itself as an open Eclipse project. If your "new code" is in a separate Eclipse project, then you want to list your library project in the new project's Include Path configuration.
In the "PHP Include Path" config popup for your new project, click "Add" and select the library project (it will only be visible here if it is also "open"). You can choose whether or not it should come before the new project on the include path or not by moving things around in the Order tab. I tend to keep my current project listed first, then dependencies afterward, just in case any of my new project's classes take precedence over same name classes in the dependency projects.
An added benefit to this is that when you open your new project, any referenced projects in the Include Path configuration will automatically be opened too.

Eclipse: Share a large framework with multiple projects?

We develop in PHP and HTML/Javascript.
Over time we developed a very big source code library, that contains a couple of hundred PHP and Javascript libraries, that we use for every project. The framework resides its own svn-repository, that we include with an external svn link in each project.
The problem is, that the entire framework itself is about 800MB now.
With only a few projects that we worked on, this wasn't really a problem, but now we have about 30 projects, that all contain a FULL copy of the framework, which takes up a lot of space, and requires constant updating of each copy.
Somehow I would like to have the framework outside the project folders. I've read about referencing other projects in Eclipse, but couldn't really get it to work.
How do you setup the include paths so that each projet 'thinks' that the framework is normally inside the project folder? And can you make a virtual link in an Eclipse project to edit files in the framework just as you would normally do, and get code assist for the libraries too?
One of the main problems is that all our code (and some libraries in the framework itself too) relies on the fact that the framework is in a folder 'framework' inside each project. I'd rather not change all those references to a different path, so maybe I need some .htaccess trick to make this work...
Does anybody else follow the same procedure?
Any advice ?
can you use the "big" project as target platform?
why-create-a-custom-target-platform
If you define it as target platform, the sources are available in your workspace, but they are placed in 1 folder for multiple workspaces. the workspaces will link to the platform, but will not check them out.

How can I link external files to eclipse in php and force it to copy to my project folder?

I use ecplise for my php projects.
I want to have an external location for all my plugins and link specific plugins to each of my projects.
I found how to link folders etc, but the actual files aren't copied in the folder, resulting in errors in the website because the files are missing. They are only inside my project.
How can I link an actual folder to my eclipse project, that is being updated automatically from the source?
In Visual Studio there is an option to copy specific resources to the output folder. I am looking for something similar here.
Some things come to mind:
I don't know if such an option exists. You could achieve that with build tools, that just to the copy on build. You wouldn't then need to reference the files in eclipse any longer then however.
You can configure the PHP include path in your project. Then you can configure the include in your application the same. Might not solve all your issues, but would work cross compatible.

How to include file from seperate remote folder in Netbeans (PHP Development)

I have a PHP project setup in Netbeans (v6.8) where all the PHP files are on a remote server and in a single directory. Whenever I save files locally they are updated on the remote server via SFTP.
I now need to edit a remote JavaScript file to add some jQuery logic but the file is located within a different directory on the webserver. How to I add this JavaScript file such that when it is saved or updated it is transferred to it's own location on the server?
When I attempt to create the file locally within NetBeans it saves to the same directory as my PHP files. I would like to be able to continue using NetBeans rather than doing this all manually using an SFTP client and a text editor. Thanks in advance.
Since you're not getting any answers I'll offer a limited suggestion. I use netbeans, but not to automatically upload like you're doing so I may be way off here.
It sounds like you would either need to change your project to have a larger directory structure that would contain everything for this to work like you want it to. Gan you go up a level or two in the directory structure, and add containing folders in your local project to match?
The other option might be to create a second project for the javascript directory, and set that to go were it needs to go. You can create "project groups" in the project view which you can use to link them together. I know this is probably not ideal, but is hopefully easier than doing your uploads manually.

How to Handle Multiple Projects in CodeIgniter?

When coding in Visual Studio, I can have multiple website projects, and I'm able to switch between them by opening each website project on the local drive. I'm confused at how CodeIgniter handles this operation in Visual Studio. It seems the programming environment is the actual install location. How do I start to code a new website while preserving the code of the previous one? Is there a script to package a project, export the package, and then import it later?
Codeigniter's documentation walks you through managing multiple applications with one installation
As noted in the link above, after structuring your application folder,
Each of your applications will need
its own index.php file which calls the
desired application.
I would like to further explain that after you have duplicated the index.php file you will need to go into your base directories .htaccess file and add a few new rewrite statements to the file.
I have previously taken my application/controllers folder and added subdirectories for each application. The controller routing would have to reflect these changes.

Categories