Array property in Phing
Posted
by Jahangir
on Stack Overflow
See other posts from Stack Overflow
or by Jahangir
Published on 2009-08-04T20:39:40Z
Indexed on
2010/04/02
18:03 UTC
Read the original article
Hit count: 384
I have a phing build file that checks the permission of certain files using the <touch> task.
<target description="list of files to check permission" name="files-to-test">
<property name="filesToCheck" value=""/>
<php expression="file_get_contents('filesToCheck.txt')" returnProperty="filesToCheck"/>
<foreach list="${filesToCheck}" param="file" target="permission-test"/>
</target>
<target description="Test the permission of files that needs to be written" name="permission-test">
<touch file="${file}"/>
</target>
It calls an extenal file(filesToCheck.txt) which is just a list of different file locations. This works fine. But it prevents me from reusing the same list in my PHP code when I want to access a particular file based on a certain key from the same external file(filesToCheck.txt).
I looked through Phing's documentation but didn't find any array Task. Does anyone know of a work around or is creating a new task the only solution for handling an array property in Phing ?
© Stack Overflow or respective owner