How to download on open SFTP file in Netbeans IDE? - php

I'm using Netbeans 8 with remote files project.
The files are located on remote server and Netbeans access them via SFTP.
I would like that Netbeans will download fresh copy every time I open a file, same as notepad++ does.
any idea how to do that?
couldn't find solution on the web.

I ended up here after looking for an answer for the same question. I couldn't find automatic download of fresh copy during every time you open the IDE but there is an option to Download manually.
Right click on "Source Files" of your project in "Projects" window and click "Download".
If you are looking only to download files which are modified in server directly then you go for "Synchronize" which is just below the "Download".
Cheers!

You have to go on new project, and then press your java file, then make a name for your file then you are in.

Related

my html file in htdocs to open in netbeans ide

how can i open my project/files in htdocs in netbeans IDE i tried looking for tutorial but there is none..i tried import but when i do it it does not have file to open or i tried open but i did not open as well..
I downloaded netbeans here i got the last one with many checks.
i also downloaded this but i cant import it as well.
any suggestions are accepted
GO to
File>New Project>PHP>PHP Application With Existing Sources.
The browse to htdocs and select your project folder.Optionally you can set the url for your application or you can just finish it there.
Did you follow this path when opening ?
Go to
File->New Project->Select a Category->Pick one from Projects.
Let's say PHP Application with Exciting Sources. Then select your project from the next window.
Hope this helps.
Cheers!
If you are wanting to work on a live site via FTP in NetBeans I would suggest using this NetBeans plugin:
Link:- http://plugins.netbeans.org/plugin/39197/ftpsitedeployer
If you are working with local files:
File>New Project> PHP/HTML5 > PHP/HTML Application With Existing Sources.
If you are working with a GIT type repo:
Create a proejct folder then initialize the repo and then pull from the repo you can also ADD/Commit/Push/Push via netbeans IDE toolbar.

Running Eclipse php project from a shared folder

I have been using Eclipse Kepler along with PDT tools on local system to manage PHP projects and its turned out to be a better choice for me then the other editors around. Only problem I've found in this environment is that content assist is only available when you open a file residing in the workspace.
Now my problem, I am assigned to work on a PHP Project which is on another system on the local LAN network. Is there any way I can add that project folder to eclipse? so that I can directly edit and save the files on the remote system?
Things I can't look into for various reasons
Using a version control system
Copy source files to local system work
on them and then upload it (kinda have to add the remote files to the
local eclipse project).
Do any modifications on the target system for my convinence eg. Adding an FTP server.
Thanks
I managed to get what I want by creating what you call a Symbolic Link in c:\wamp\www (using WAMP) folder which is also my eclipse workspace, for the network shared project I wanted to import into Eclipse. To do this open an elevated command prompt and run this command
mklink /d projectname \\network_shared_folder
/d option creates a directory symbolic link. Now, the network project will be available as a local project on the web root which can be easily imported into Eclipse (or any other IDE)
Hope this comes in handy for someone who stumbles upon this problem. Now I can get content assist for any file in the project.
Thanks.
In the project explorer if not exist create a new project then:
1) right-click the project and select New > Folder
2) Specify a name for the folder
3) click on Advanced
4) Check Link to alternate location (Linked Folder)
5) Enter a file system path, or click Browse to select a folder in the file system.
6) Click Finish
Check here for more Creating Linked Resources on Eclipse
After hours of searching, I share the solution finally found: symbolic links are not usable if the project is managed via git.
Another solution is to use the fileSync plug-in (http://marketplace.eclipse.org/content/filesync) to automatically copy folders from the source project to user projects.

sync project in netbeans both ways via ftp

I have a question about netbeans.
I made a new netbeans php project, configured it with the existing ftp settings, and it started downloading all the files to my local hd, so far everything is working correctly.
but because I'm using a php framework, which will automatically generate some files for me makes a file, it won't be synced to my local hd.
So my problem is as long as I make new files in netbeans it will work correctly, but when files are generated outside netbeans it won't.
How can I configure netbeans so it will sync both ways via ftp?
You can't as far as I know. You have to manually right click on the project/folder you want to update and click Download or Upload. Note that this will overwrite any changes on the receiving side (e.g. downloading files will overwrite local changes and uploading files will overwrite remote file changes).
Alternatively, you can have the Upload Files On Save or On Run options enabled, but this will only work for local->remote synchronization scenario. You can access this option by right clicking your project, choosing Properties and following the screenshot below.

Eclipse problem keeps opening old versions/copies of the files

I am having problem with my Eclipse PDT version. I keeps opening older version of a file until I close it and open it again.
So what is happening. I edit a file with Eclipse - test.php. I close it. Then I compare it (test.ph) with another one in WinMerge, save the changes and when I open the file again in Eclipse it is still the same as it was before I changed it in WinMerge. I have to close the Eclipse and start it again to be able to open the file with it latest modifications.
I have noticed the same problem when I am opening a file downloaded from FileZilla. I have a local copy of the file that is online opened in Eclipse, then someone changed the file online. I right click -> "View/edit" from FileZilla, choosing to overide the old local file with the one online, but then I see the old file again, without the changes. I am sure that there are changes cause when I downlaod the file somewhere and open it , I see them.
Is there something like a cache in the Eclipse that may prevents me from viewing the latest changes. I seems that is happens only when the changes were made outside/not usign Eclipse. Any ideas?
Yes, Eclipse likes caching a lot... one of the reasons I hate it.
You should be able to have Eclipse auto-refresh your files in the Preferences window in the Window menu (type Refresh to show up the relevant pages). In my not so recent version of Eclipse, I have to put checkmarks on these:
Refresh workspace on startup (in Startup and Shutdown)
Refresh automatically (in Workspace)
Is there any way to open a file outside the project without it being cached and to be able to reopen it and see the actual code?
This is a huge disadvantage of the Eclipse. I do not know how things like this could be left the way they are?
The answer given by Archimedix solved a similar problem (in Java) that I have where the config files (hbm config and log4j) that I have modified in the eclipse editor are not being copied to the output folder. Instead an older version of the file is being copied every time I compile. I followed Archemedix solution, however, note that you still need to restart eclipse for it to take effect. After restarting eclipse, during compilation, any changes I make to the config files are now being copied to the output folder and not the old version.

php project through ftp (Netbeans, Eclipse or any free IDE)

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.

Categories