I have been using Eclipse for Remote System Development and after hearing a lot of good things about Netbeans for PHP development, I wanted to give it a shot.
I ran into couple of issues even before starting:
1. Downloading complete remote directory to my local machine:
I work on multiple projects located on a development server and the code base is pretty huge. While setting up new PHP remote project using sftp to access my remote directories, Netbeans started downloading all the files from the remote location I specified. This is a bit annoying as it is taking really long to download all the files (includes large videos which are part of the projects).
Eclipse remote system development (and most other editors like EditPlus), on the other hand, simply shows me the remote file structure and only downloads a file to local temp dir when I open it.
Is this behavior standard in Netbeans?
2. Will external file modifications cause sync issues?
I usually update my svn by connecting to the dev server using putty. Since Netbeans is trying to maintain a copy of it's own on my local computer, will updating the source files externally outside netbeans create sync issues?
3. Can I manage remote svn repos from within Netbeans?
Since I already checked-out my svn projects on the dev server, can I use svn from within netbeans to commit or update?
Yes, it is standard. Netbeans downloads the remote application so that it can scan the local copies to enable code-completion.
It shouldn't. By default, Netbeans is almost immediately aware of any changes you make to project files outside of Netbeans.
Yes.
Related
I'm developing web app using CodeIgniter PHP framework. The server I'm working with does not support any type of source control (i.e. Subversion) unless you go to a higher price tier.
I would still like to put the code under some sort of source control. Does it make sense to do the following:
Install git or SVN on my local machine and develop there
Copy changes from my local machine to development directory on the server (using FileZilla, WinSCP, etc.) and test
Copy changes from development directory to production directory on the server
Does that sound reasonable? Are there better alternatives? Thanks!
If you are using svn locally it's a bit dangerous because then you will need to protect also your computer - I think the best way is to work with the commercial sites offer fully supported svn/git - like http://www.beanstalkapp.com/ or http://www.github.com
You could use source control on your local machine (SVN, Git, etc.) and use an open source tool like Capistrano to deploy the code from your local source control repo to your server via SSH. Or if you're limited to FTP, this blog post has a potential solution.
An advantage of using a tool like Capistrano instead of directly mirroring the files on your local machine to the server via FileZilla or WinSCP is that Capistrano will version your deployed files so that, if you end up breaking something and need to roll back quickly to the previously-deployed version, it can be as easy as changing a symlink to the previous deployment directory.
Does that sound reasonable?
Partially, in p.1. But even in this case I'll suggest to have your repository also at some Repository-Hosting (BitBucket, GitHub, Assembla)
For pp. 2-3: your deploys must to be automatic and non-interactive, thus - you'll have to select another tools (for using in post-commit hook of SCM-of-choice)
Somehow better alternative to 2-3 may be:
Use 2 different branches (DEVEL and PROD) as sources of DEVEL and PROD dir
Post-commit hook, which upload only changed in committed revision files to corresponding dir (NCFTP for FTP, SCP with scenario for ssh)
Main development happens in DEVEL branch
PROD have only mergesets from DEVEL
Workflow is SCM-agnostic and scalable to any reasonable amount of branches and developers
I need an effective way to automatically push changes made in Eclipse to a test web server. These are all PHP changes. I am thinking SCP or FTP would be great with an easy to use plugin, but I would be open to other suggestions.
Background
At my company, we have Windows development machines, but the only way to test the PHP is to push the code over to a Linux machine that is running an Apache installation. Normally, I would just test locally, using WAMPServer or XAMPP, but I just started with the company and their code base is full of OS specific code (one day we will fix that!).
I have currently setup Git on my machine and I simply commit everything over to a bare repo on the test server. Then I have a post-receive hook that forces a pull into the actual Apache web accessible folder.
This git setup works fine, but I really don't like polluting the blame log with useless commits (i.e. I added a comma to line X in javascript). Things like that are not useful to other developers.
In the end, I won't be pushing from my test server anyway. Instead, I'll be pushing from my Windows machine to a central git server for our team (once I get it set up), so I'm not really sure we should be using version control to deploy to the test web server. It seems like using an SCP or FTP plugin would make the most sense.
Question Restated
Are there any Eclipse plugins that could automatically SCP/FTP to a directory on file save? I've searched the Eclipse market place and I am really not sure where to go with this.
Thanks for your help!
Have a look at the Remote System Explorer plugin for Eclipse: http://eclipse.org/tm/
I have a netbeans php project that is local on my PC. I have it setup to save on the remote server "on save". This all works well. I now have a second developer in the mix who is doing the same thing to the same server .
Is there a tool/plugin or even standalone tool that that can do a recusive diff or project diff between my PC and the remote server?
Thanks
The "Copy files from Source Folder to another location"-feature is not meant to be used for more than one developer. It's good to use that feature for a local preview, for example when copying the files from the source folder (on save) to the webroot on the same PC or a local test server. By no means should the same preview folder be used by different developers. You still could use an external tool to have a diff done, but be aware that any files in the test folder are overwritten by Netbeans and it's pretty hard to find out which file was edited last by which developer.
Use a versioning system if you need to work on the same code by more than one developer.
I have the project in the remote server and i have only ssh access. How i can work with this project? I am looking for information for either PhpStorm or NetBeans.
You have several options, depending on your system.
You can rsync or scp up your files when you want to publish.
You can use version control (cvs, svn, git, mercurial, ...) and via ssh perform an "update" when you wish your code to go live.
You can set up a sshfs filesystem locally.
I don't know about NetBeans, but PhpStorm has a feature that allows uploading files as soon as they change to a server (via FTP or SSH).
I don't have a lot of experience with this feature but it does seem to work well. PhpStorm can also be configured to deploy changes that occurred outside (it seems to do so as soon as it regains focus). It also seems to properly delete files that have been deleted from the project, so it's a real sync, not just "upload".
See how to configure it under "To have PhpStorm upload changed files automatically" here: http://www.jetbrains.com/phpstorm/webhelp/uploading-and-downloading-files.html
I am new to Netbeans. Is it possible to work directly on the server files through sftp to avoid downloading/uploading each time. Will the intelisense work the same ?
If it is possible I can't find how to do that or what plug-in i need to use. And if it isn't what other free php IDE offers this option ?
So.
With Netbeans
To work directly through ftp/sftp on Netbeans 6.8
Open a new project and select "Php application from remote server"
It stills need a local storage for the files so that you can work on them so you need to specify a project name and it's local folder
Next step is the remote configuration: Click on the "Manage" button to add a new connection by giving it a name and selecting sftp or ftp. Then enter the connection configuration with the initial directory
Back on the remote configuration screen the upload directory must be the same as the "initial directory"
On the next screen you can retrieve all the project's sources
Once done each time you will save a file it will be automatically uploaded to the server. If not go in the project properties and check "Upload Files" is on "OnSave" mode in the "Run configuration" section.
PS:
I had problems with a "The authenticity of ... can't be established. RSA fingerkey is..." warning that kept appearing each time I saved. If so just create an empty and writable known_host file and point to it in the "Known host files" property of your remote connection, then restart Netbeans (seen on netbeans forum)
Edit: At this stage the behaviour still isn't quite what I am expecting since when you open a file netbeans will open the local copy and overwrite the remote copy when you save.
Edit2: Apparently you can not open the file directly from the server in Netbeans. You'll have to download the file before modifying it.
General solution
One workaround is to use an utility that will map the remote storage as a local drive. I know Fuse does it for Mac & Linux. I haven't found one for Windows yet.
Looks like NetBeans added it a few minor versions ago: http://blogs.oracle.com/netbeansphp/entry/sftp_support_added.
Just confirmed that this support is in the 6.8 version I have running.
The intelisense will work the same as long as you have all of the completable objects within your project scope, it won't pull libraries still on the server. Download a local copy of any 3rd party libraries your project may need and add them to your project's include path to get full code completion.