-
Notifications
You must be signed in to change notification settings - Fork 40
Building phpWebSite
To compile the software, of course! Haha, but seriously, compilation is a small part of building a software release. Since phpWebSite is indeed written in php, you can simply clone the repository into a web root and have a website up and running in short order. However, if you are interested in developing phpWebSite, you should also write unit tests, document your code properly, and follow good programming practices. Build.xml is an Apache Ant build script (analogous to Makefile for you GNU AutoMake folks). Ours runs unit tests, generates documentation, and runs code metrics. We chose Ant since Jenkins Continuous Integration works well with it.
You will need:
- Apache Ant, available from your favorite package manager
- Configure PEAR to auto_discover repositories:
pear config-set auto_discover 1
- PHP QA Tools, which can be installed from PEAR:
pear install pear.phpqatools.org/phpqatools
- ApiGen, which can also be installed from PEAR:
pear install pear.apigen.org/apigen
Then, in the root of your phpWebSite working directory:
ant
-
ant cleanwill clear out all of the build-related stuff and should shut Git up as well. -
ant lintsimply checks every .php file for syntax errors. If you intend to submit a pull request, you should have at least done this if nothing else. -
ant phplocruns PHP Lines Of Code on phpWebSite -
ant pdependruns PHP Dependencies on phpWebSite -
ant phpmdruns PHP Mess Detector on phpWebSite -
ant phpcsruns PHP CheckStyle on phpWebSite, yet another good idea if you want to submit a pull request. -
ant apigenruns APIGen, a documentation generator, on phpWebSite. For Pull Requests, your code should be well-documented and properly namespaced, and this step will help make such things apparent. -
ant tarballbuilds a phpWebSite tarball -
ant rpmbuilds a phpWebSite RPM - NOTE: RPM configuration is pretty custom tailored to our internal setup at this time and may not do what you want. You should probably take a look at the .spec file before building an RPM. -
ant buildis the default target when you run ant, and runs the above in more or less that order, and does not automatically build a tarball or RPM.
If you are interested in setting up Jenkins CI so that your own projects can be continuously integrated, I recommend reading this excellent guide all about it. As far as understanding Continuous Integration, best thing to do is just start from the guide and then tweak it as you go.