PHP and Netbeans - working with sftp or svn for remote sources


Two scenarios for you:

1:
I am using Netbeans with built-in sftp. I will get a copy of the remote source on my computer and edit it. Netbeans will synchronize the local copy and the remote source.

2:
I am using svn. Inspect the remote source. Open a local project in netbeans. When I want to see my changes, I must first commit, then make an update from ssh from the server, and then open my browser and see the changes. Boring.

I want to go to the first scenario. This is not a production environment. And currently I'm the only one working on this project. But one day I get a colleague who helps me by simply performing QA or fixing one simple error for me and sftp directly into the development environment, it isn’t cool if I want to work as it helps me or something else ...

Has anyone been in the same situation? I am sure there is another way that I have not discovered yet;)

+4
source share
2 answers

I use a combination of two scenarios, SFTP to update the remote source on the server and SVN to just keep track of changes and history so that if I mess up something, I can throw it back. NetBeans supports both, when you create a PHP project through the wizard, you will be taken to the third page, which says that “Run the configuration of the project creation page”, select “Remote website” (FTP, SFTP), then you can change your settings to match your server’s data, and you can change the “Upload files” from “Run” to “Save” so that whenever you save a file, it is automatically uploaded to the server.

For SVN, after creating a project, simply right-click on the project name and select "Command" from the menu, and then import the project into SVN into the SVN repository if it is already in the SVN repo, you can use the menu command from the top menu bar and select "Check" to create a project from a source and automatically configure it under SVN control, then you can simply right-click on the project name and change "Run Configuration" to configure sending the project to a remote server on Save / Run, etc. .d.

Hope this helps.

+2
source

First, you must use the version system. Therefore, I think that you will use SVN anyway.

The best thing you can do, imho, is to add a link to " on commit, update the test server to SVN. Now, to see the changes on the test server, you just need to do your job.

However, I do not recommend doing this on a production server, because it’s better to check if your material works before deploying it. In addition, it tends to commit files frequently, which is bad.

+1
source

All Articles