Sublime Forum

Built-in FTP

#1

Hi there.
It would be nice if Sublime 2 will have it. Currently, all FTP plugins are buggy enough.
I love ST2, but I have to use ST2 & NP++ 'cause NP++ has built-in plugin.
FTP plugin in NP++ is pretty well, except one thing: it download files and save it in hdd before using. In this case, it has many problems.
Why built-in, instead of plugin - it won’t have problems like NP++. For example, if you saved file, but there’s an error in FTP plugin with saving to remote destination, text editor will think that file successfully saved, although it won’t.

0 Likes

Sublime caches old version - lost hours of coding
#2

Although built in ftp would be something nice to have, it’s totally not a valid criteria to ditch the editor.

If your work is mostly based on working remotely you are doing it wrong…

0 Likes

#3

what are you saying!?

0 Likes

#4

First of all, be polite.

Second, working on FTP is wrong because of security and reliability. Your problems with N++ are not with N++ per se, but with working directly on FTP. It’s just a matter of time until you screw the server (i know, you work this way for years, nothing wrong can happen on your watch)

Try a slightly advanced solution: either deploying via Git or using a dedicated solution: capistrano and phing are the most known.

Bottom line, working directly on FTP is wrong.

0 Likes

#5

Sorry if my message seems impolite. I was confused.
Thank you for recommendations, especially for git.
I almost didn’t work with it.

So, if I understand it correctly, I can work with git on active project(I mean on web-server directly), right?

0 Likes

#6

Wrong. You develop/debug locally. When you are done, you commit to git then push on server. Sounds more complicated that it really is, but is better in any way than working on FTP directly.

Read here and here (also a search for deploy with git on google would be helpful)

0 Likes

#7

I’m working with php and mysql, and I can’t develop/debug it locally.
Thanks for the links.
You changed my mind :smiley:
If it’s not hard for you, tell me plz how can I set it up.
I wanna to set my webserver www folder as main repository and simply edit it in my pc. Do I need to install git to the webserver, which commands do I need?

0 Likes

#8

I think you’re going to need to start with baby steps. I understand the need to work directly on an FTP server in some cases. My parents own a small catering company. I edit their site directly on the server. But most things I do, I’ve begun embracing Git.

Based on your questions, it sounds like the first thing you need to learn is how to build up a local development environment. Lucky for you, you’re doing PHP/mySQL development. Look into WAMP solutions (That stands for: Windows Apache MySql PHP). If you’re on a Mac, look for MAMP solutions, and LAMP solutions if you’re running a linux distro. See wampserver.com/en/ for more. These are easy to setup development solutions that don’t require you to do much php, apache, or mysql configuration to get a working environment running.

Once you get a local website up and running the next big question is this: can you create a local copy of what you’ve been working on remotely? Hopefully what you’re working on directly thru the FTP server is small. If so, copy it down and make the necessary tweaks to get it working correctly (path and database changes in config files for example). These tweaks aren’t something that we’re going to be able to help with – it just depends on your code and how it works. This includes copying down the mySQL info (or at least a subset of it).

Once you’ve gotten that far, now you need to start thinking about changing your coding mindset. Now when you hit save, you aren’t saving to an FTP server. You’re saving locally. The idea here is that you make changes on your desktop. If you’re working on a bug, fix the bug. Then copy up ONLY the files that you’ve changed. If you’re working on a new feature, finish the feature and copy up only the feature specific files. This is where a Git repository comes in handy. Git will track the changes to your files, allow you to commit changes, then deploy those changes (among MANY more features).

So for now? Forget Git. Work on getting a local development environment running. When you’ve got that working, learn to code locally, then deploy. When you realize how difficult that is to do manually, THEN start learning Git.

If you’ve read all that and you think, “screw that, I don’t have time to learn that much” then here’s an alternative solution. If you must work remotely, then download a copy of WinSCP and setup your FTP connection with that. Inside the options for WinSCP you can define what text editor to use for ascii files. Find the path to sublime text. Now, do all your FTP browsing in WinSCP and double click a file. It will open in Sublime Text. Now in ST, you can make your edits and hit save (or CTRL-S) and WinSCP will upload the file for you. This method is what I used before I embraced Git. In fact, I used it with N++ because it was better than the FTP stuff that N++ had.

That’s my two cents anyway - everyone works a little different though, so find what’s comfortable for you. Good luck! :smile:

0 Likes

#9

Thank You for such many words! :smiley:
I want to start working with git, but I still don’t want to create a local development environment (and I have a big project :smiley: ).
I understand it’s not good solution, but…

0 Likes

#10

Do you have one good reason for this?

0 Likes

#11

Please don’t ask me & don’t try to persuade me :smiley:
It’s more more convenient for me.
So can I use git with files on web-server, if so, how?

0 Likes

#12

[quote=“ArtDesire”]

good reason for this?
Please don’t ask me & don’t try to persuade me :smiley:
It’s more more convenient for me.
So can I use git with files on web-server, if so, how?[/quote]

So, if you make a mistake, the web site goes down? At least I hope you are doing this for yourself and not for someone else.

Anyways, to answer your question - with git you would work and test your site locally. When everything is good you issue the command ‘git push’ and that updates the site. It is a little bit more involved than that, but nothing too hard.

0 Likes

#13

If you insist on working directly with the remote files, then Git won’t help you - at least not easily. As I mentioned earlier, there are steps you need to take BEFORE learning Git. The first step is to learn how to setup a local development instance. If you aren’t willing to do that, then I wouldn’t bother with Git yet. Just make sure your server makes backups often. :smile:

0 Likes

#14

yep, you’re right. :smiley:

The main reason why I want to work remotely is I don’t like huge apps like wamp & it’s too hard to setup my site locally(I’ve made my own CMS), often I make changes in server configuration.
Sometimes I even won’t be able to check my site locally, because It uses many API’s which listen to some queries from another servers.

0 Likes

#15

My xampp folder has about 1.2Gb. Half of this is mysql data, a quart of this are logs. Considering the cost of the storage today, this is not huge at all, not even for a SSD. So this argument is not valid.

Hard to setup? Download, extract, done.
If your own CMS is hard to setup, probably you did something wrong.

At the end of the day i just hope you realize that your workflow is the problem. Not N++, not sublime not any other editor…

0 Likes

#16

I am new to ST2 and really like it. I immediately bought it after a short testing period. I am developing Web-Projects on a Zope Server.

To develop in Zope even on a local installation, the most convenient way ist to do this via ftp. I bought the sftp plugin, which is big help. But to be able to have ftp
folders in the sidebar would be most helpful. I agree when developing in PHP for example it is easiest and best to use wammp or xammp. But to have ftp in an editor
should be imo a standard feature.

Happy new year btw :smile:

0 Likes

#17

I struggle with the answers provided here. I understand git, I understand the obvious benefits of code versioning with it, not deploying buggy software to a live server, etc… I get it. I want it. It sounds great -on paper- but I’ve never found a good way to actually -use- it because of databases.

I’m not going to pull down a 2gb SQL database as part of a git pull every time I start to develop. And when working with CMS frameworks like drupal, wordpress, joomla, etc… the database structure of those changes almost everytime there’s a core or module update (which is often.) So just doing the download ONCE and using that for developing against is not an option. Setting up something complicated like a sql replication system to your local workstation is not only silly, but would be an interesting conversation with your IT staff at work as to why you need to open your SQL ports on your local workstation to the internet.

I spent months trying to find some kind of git workflow working where every time I saved a file in an IDE it pushed it to the server with git so that I could test, and when I was finished commit it to version control. Everywhere I looked for help, I kept getting the same answer:

“Git is not a deployment tool”
(stackoverflow.com/questions/9619 … git-github )

In the end I settled on editing files directly over SFTP and committing gits on the server via remote desktop once I was happy with the results. It’s FAR from an ideal solution, but it was only one that I could figure out that is manageable.

Because of this, lack of good SFTP support is what has stopped me from purchasing sublime text because I love every other aspect of it. If anyone has a better solution for me, I’m all ears… but saying “if you’re editing remotely, you’re doing it wrong” and using that as a basis to not have a feature that 95% of all other IDEs use is a bit narrow minded.

0 Likes

#18

FTP sounds like an amazing addition to the program to me! :smiley: Hope to see it in SLT2 or maybe SLT3!

0 Likes

#19

@anakinjay: there are pretty rare situation when you will always need a full sql dump. Most of the time few entries would be enough (like, let’s say, 20-30 posts). I develop this way for about 2 years or so (before that i also used to work on ftp, but loosing about 2 weeks work was good enough to make me to do the switch)

Btw, this tool looks interesting: dbv.vizuina.com/

0 Likes

#20

[quote=“anakinjay”]I struggle with the answers provided here. I understand git, I understand the obvious benefits of code versioning with it, not deploying buggy software to a live server, etc… I get it. I want it. It sounds great -on paper- but I’ve never found a good way to actually -use- it because of databases.

I’m not going to pull down a 2gb SQL database as part of a git pull every time I start to develop. And when working with CMS frameworks like drupal, wordpress, joomla, etc… the database structure of those changes almost everytime there’s a core or module update (which is often.) So just doing the download ONCE and using that for developing against is not an option. Setting up something complicated like a sql replication system to your local workstation is not only silly, but would be an interesting conversation with your IT staff at work as to why you need to open your SQL ports on your local workstation to the internet.[/quote]

Wow, someone understand me! :smiley:
Although I’m not gonna use git to store files remotely(not web-server), I wanted to have file history & update files on web-server every time.

0 Likes