在源上载中运行脚本

I'm using Netbeans 6.9 to develop PHP code; testing happens locally on my PC (XAMPP); once done code is uploaded using Netbeans upload facility to the production web server.

I recall reading about Netbeans capabilities running scripts when "building" the project, and looking for a primer about it. Particularly I'm looking for some ways to achieve the following, right before uploading files to the production server: - strip comments from PHP sources - minify PHP - minify Javascript & CSS

Can someone enlighten me?

I think what you may be aiming for is a tool like Apache Ant. It runs an XML with several targets which usually are nothing more than some shell scripts.

So this means;

  • Setup Apache Ant
  • Find some CLI/shell scripts to do the jobs you mention
  • Create an ANT build file with the FTP upload in the end
  • Run the ANT file

More info on Apache Ant; http://ant.apache.org/