CHAPTER 19 ■ AUTOMATED BUILD WITH PHINGTable 19–5. The Attributes of the copy Element
Attribute Required Description Default ValueTodir Yes (if tofile not present) Directory to copy into. NoneTofile Yes (if todir not present) The file to copy to. NoneFile No Source file. NoneTstamp No Match the timestamp of
any file overwritten
(it will appear unaltered).falseincludeemptydirs No Copy empty
directories over.FALSE
Mode No Set the (octal) mode 755Overwrite No Overwrite target if it
already exists.noInput
You have seen that the echo element is used to send output to the user. To gather input from the user, I
have used separate methods involving the command line and an environment variable. These
mechanisms are neither very structured nor interactive, however.
■Note One reason for allowing users to set values at build time is to allow for flexibility from build environment
to build environment. In the case of database passwords, another benefit is that this sensitive data is not
enshrined in the build file itself. Of course, once the build has been run, the password will be saved into a source
file, so it is up to the developer to ensure the security of his system!
The input element allows you to output a prompt message. Phing then awaits user input and
assigns it to a property. Here it is in action:
propertyName="dbpass"
defaultValue="default"
promptChar=" >" />