How to set up a new library in NetBeans PHP project? - php

I'm a newbie to NetBeans IDE (version 8.0.1 for PHP) and I'm trying to create a library containing the functions I'd like to use frequently (like DB connection, string manipulation and so on) so I'd be able to include it to my further projects.
The project is connected to GitHub repository and remote SFTP folder (if those notes are important).
As was described in the answer to the question Creating/accessing libraries in netbeans I tried to pick Tools ->Libraries menu item. But the button new library in the opening window is inactive.
I have no libraries in the Project navigation window as well. So I'm definitely doing something wrong.
Cound anyone point me why I'm not able to create a new library?
UPDATE TO THE QUESTION: What exactly I probably need is a tool to attach php file with library functions and classes to the project so I could just include it to the index.php file (or anyone needed this library).

Related

Eclipse Orion PHP plugin

So for a project I need to check if I'm able to get code completion working for Eclipse Orion (on the IBM DevOps Services WebIDE) when coding in PHP. There's a default plugin available but it only provides syntax highlighting. Code completion is the deciding factor this time.
Just googling around I've found some plugins here and there in various git repos but they seem to be for an outdated version of Orion, hence not usable here.
So, just a quick throw out if someone is using IBM DevOps Services WebIDE (or some Eclipse Orion implementation) with a PHP plugin with code-completion? Preferably a link to installation steps since I need to educate a programming class on how to set everything up from a clean slate.
Orion's Go language plug-in provides a straight-forward example of contributing content assist via a plugin, see http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.ui/web/plugins/languages/go?id=R7_0 . To make something similar for PHP you would create a plug-in with the same shape that defines at least the "orion.edit.contentAssist" service, and then install it in your Orion/WebIDE on its Settings-Plugins page (point it at your plugin's .html file).

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 Juno - How to make it aware of classes and function in remote project?

I have created a connection in Eclipse within Remote System Explorer perspective.
I can reach the the files on the server.
Unfortunately autocompletion doesn't seem to work and the IDE isn't aware of classes and functions residing in project files.
How can I tackle this kind of projects (remote) in order to get the above mentioned (autocompletion, classes, functions) ?
Please take a look at "Fixing PHP autocomplete with Remote System Explorer" here: http://www.patrickjwaters.com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35

Linking a PHP project to Visual SVN and Visual Studio 2012?

I am looking for a way to be able to use VisualSVN with my PHP project.
I tried adding my whole projet into Visual Studio 2012, but the files are not added into the solution explorer, thus I cannot push the solution to the SVN server.
Is there a legit way to make a PHP/html/javascript project inside VS2012, or another way to use VisualSVN for a PHP project?
I must use this SVN since this is the only one supported by my college at the moment.
I created a new javascript project and renamed the file to index.php. I then created folders such as css and js and dragged all my website's files into VS2012. I am now using it as a code editor and I can commit my changes right away. I wish VS had a PHP template tough (even if it wouldn't support it's syntax, I wouldn't care!), it would be less of an hassle.
Everything's fine now.
there are a bunch of tools to create PHP projects in Visual Studio, complete with code coloring and code completion. just search for "PHP" in the Visual Studio Gallery.

How to create a PHP project with IntelliJ Idea 9?

I can't find how to create PHP project with IntelliJ Idea 9. It only offers "Java module" and "Maven module" to choose when creating a project. PHP plugin is installed, but how to employ it?
UPDATE: Web module type is available since IntelliJ IDEA Ultimate 11. Use Web module type to create PHP projects in IDEA.
Old answer prior to IDEA 11:
It's a known limitation, IDEA doesn't support creating project without any module type like PhpStorm/WebStorm products since it supports many languages and technologies. But it also doesn't have a special module type for PHP or web projects yet.
At the moment you should use dummy Java module, you can omit creation of the src directory and all the other Java specific stuff, but you have to choose Java module type for your PHP/web projects.
This may change in the future IDEA versions as we plan to support opening PhpStorm/WebStorm projects in IDEA and vice versa.
There is also a request to support web modules in IntelliJ IDEA that you can watch for progress.
I'm on IDEA 11.0.2 and I still have to create a barebones Foo.java file in the non-Java module I want to create. So frustrating. Meaning that if I want to create a module for my JavaScript project or for my PHP project I need to put that file in there and do New module...from existing sources, then delete the Foo.java.
There's got to be a better way!

Categories