I am currently using Aptana to edit files and upload them directly to the webserver whenever I save them. But it's a big project I am working on and I regularly need to search for a specific line, or piece of code, in multiple files. it's literally 100's of files, and Aptana's search function does not work directly on FTP.
Now my question is, is there a way to store all the files locally AND sync them through FTP whenever I save them?
If it is a big project you should really consider not editing your files live on your server, but edit them locally and use some kind of revisioning system (cvs, mercury, svn, git, clearcase, perforce, ...). Have you considered your options on using an external tool to sync your files from your local copy? Such as rsync or scp.
Do you work in a Windows or Unix environment?
Related
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.
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 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.
Ok,
This seems like something that would be obvious, but I haven't been able to figure this out.
I just started using Solar PHP5 Framework http://solarphp.com. It is a great php5 framework. But with any new framework the is a learning curve.
Issue: Solar uses many pre-written scripts to make directories and files for you. Making it easy to rapidly deploy a site. Being that it uses these scripts, it makes symbolic links to files and directories. (Example: Chapter 1 in the manual) This is great until you need to export your entire root directory to upload to your server or make another instance on another development computer. The problem for me is, when I do this, the files are editable, but do not reflect any changes when I refresh a page. Its like it doesn't update any code. The only way I can accomplish changes or updates, is to (essentially) run the site set-up each time, which involves running all the setup scripts, setting up the DB connections, etc. This is a total pain.
Question Is there any advice out there on doing this where I can just export the working root directory, to easily upload to server or other dev machine, without having to run those scripts over and over again. I know its something easy but I do not know exactly what to search for.
Is the a certain method for exporting directories/files that use symbolic links?
You might try using rsync instead of ftp to deploy the site. rsync will respect symlinks. Of course you will need have ssh access or mount the server over ftp/sftp with FUSE. If youre using SVN you could also ssh into the server and do an svn export or checkout.
I'm looking for an editor that can read and write remote PHP files via sFTP. I'm talking about not having a local copy of my PHP files.
But here is the tricky part : I'd like that editor to be aware of all the files in my projet, and provide me with intellisense-like auto-completion, classes structures, etc...Just like Eclipse PDT, Aptana and NetBeans do, but with the "remote project storage and awareness" feature.
Do you know about any editor with these features ?
Thanks !
Edit : I'm absolutely not working on my production server, but on a development server. It's mostly because I need to works under windows on my desktop PC and don't want host my projects locally for various compatibility and tools availability reasons, and use linux as a server OS.
May not be a good idea:
Warnings:
1) Disconnect:
What if you are coding and your connection gets lost, you may get a corrupted file or loose some work. Disconnects occur much more often that power loss in your home/office, and you can safeguard by using a small UPC - that will give a minute to save your work.
2) SCM:
Use git, mercurial, svn or what have you, to speed up deployment. Increases ability to share code, backup and roll backs.
3) Auto completion will not work very well over network connection, because ( at least in NetBeans) it scans your project to figure out what you want to auto-complete. It takes a few seconds even on a local machine.
Solution:
If after all of the above you still want to do it, you can trick your editor by mounting remote storage as a local drive. You didn't specify your OS but on Mac and Linux - you can easily do it - take a look at Fuse. http://fuse.sourceforge.net/
Khmm apperatnly there was an attempt to port Fuse to Windows:
http://fuse4win.4host.ru/
Hope that helps
Update
There are also a few commercial products - one was recommended by macworld I think ( they are both for Mac and Windows)
http://en.wikipedia.org/wiki/WebDrive
http://en.wikipedia.org/wiki/ExpanDrive
On Windows the Zeus editor can do seamless ftp/sftp editing.
These remote ftp files can also be defined to belong to a project/workspace.
But the Zeus PHP intellisensing will only work for local files.
You can use NetBeans for this, you will have your project saved locally but you can set to upload the file anytime when you save that file. Right click on your project, Properties, Run Configuration, Run As: Remote website. Click on Remote Connection: ... Manage and add your FTP account. Don't forget to set Upload files: to On Save. I have had no problem with this configuration and I am working for one year with NetBeans.
For quick editing I am using PSPad.
I don't think this is something that actually exists. Mainly because intellisense and class structures rely on being able to parse your complete project. Doing this over FTP would take way to long to actually be of any practical use.
You might be able to find an editor that will automatically upload any change you make locally though.
I'd second the comments about not working directly on your live environment.
As you've mentioned Eclipse / Aptana - perhaps consider using something like Git or SVN, with a post-commit hook to immediately publish to your live environment each time you commit. That way you reduce the risk by being able to easily roll back any changes that break your live server.
You can use Eclipse (with suitable git/svn plugin) to check out your entire site direct from the repository, and have all the code completion goodness you need. "Saving" is then just a case of committing your changes back to the repository, which would automatically update your server thanks to the post-commit hook.
It's still not ideal, and very risky to develop on a live server, but if you really have no preview environment, then this is perhaps slightly safer than simply working directly through ftp.
I'm curious why you'd need to not keep a local copy - yet you've said the project seems quite small - perhaps taking another approach to the problem would be safer?