3

I'm using phpStorm to develop and I want to process some files before it's uploaded to the FTP server.

For example, I want to strip all comments on PHP files or even compress/obfuscate it, or minify css and js.

I know that there are some plugins to minify css and js, but I don't want to do this over my local files, I just want to upload it processed, but leave untouched my files.

I'm currently using Git, so when I commit a change, all affected files are automatically uploaded to the FTP server. It could be great to commit the changes, process the files and upload the result to the FTP server.

1 Answer 1

2

It could be great to commit the changes, process the files and upload the result to the FTP server.

That would mean, in a post-commit hook:

  • update a separate repo
  • change your files in that separate repo
  • sftp the separate repo content

In other words, you would upload a processed working tree from another local repo, and not from your current local repo (where you don't want to change your files).

Sign up to request clarification or add additional context in comments.

2 Comments

But, the process to upload to FTP is done by phpStorm. So, the preprocessing must be done by phpStorm.
@Juanjico so can't you commit to a first repo, and update the second repo which is managed by phpStorm, meaning phpStorm would do the preprocessing there?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.