PrefaceThis article it the follow up of the Writing a Big Application in Ext post and it assumes that your application is written, at least to some degree, that way. It also assumes that the server side language is PHP 5.x, other users can take the idea and write the server side logic in their languages. It is written on and for Linux environment, again, users of other systems must accommodate it to their environments.
FILES= Ext.ux.grid.Search.js Ext.ux.IconMenu.js Ext.ux.IconCombo.js Ext.ux.ThemeCombo.js Ext.ux.LangSelectCombo.js Ext.ux.grid.RowActions.js Ext.ux.grid.CellActions.js Ext.ux.tree.ArrayTree.js Ext.ux.FileUploader.js Ext.ux.UploadPanel.js Ext.ux.FileTreeMenu.js Ext.ux.FileTreePanel.jsNext, we need
Makefile(file with rules for
include filelist application-all.js: application-all-debug.js java -jar ~/bin/yuicompressor.jar application-all-debug.js > application-all.js application-all-debug.js: $(FILES) cat $(FILES) > application-all-debug.js clean: rm -f application-all-debug.js application-all.js install: application-all.js # whatever you need to do to upload # new version to production serverYou can download yuicompressor here and you may need to install some “devel tools” and java on your Linux box for the above to run.
The SwitchWe need a server-side logic that would generate the includes for individual files on the development system and one-file include on productions system. Decision what system it is running on can be also automatic. For example, our public, production web server has name
learnfromsaki.comand our development system has name
extjs.localhost. We can easily check if
"extjs.localhost" === $_SERVER["SERVER_NAME"]and if yes we can run development branch if not we run production branch.
The Development CycleWith all this in place, if you add a file you just add it to the file list, test it and debug it on the development system and if everything is works you issue the command:
make installThe compressed version is created and it is uploaded to your production system. The same is true for editing of a file, you only won’t modify your file list. If you delete file, just remove its line from file list and