此目标正常
<target name="cleanlogs">
<echo msg="clean log do nothing !!!!not ready!!!!" />
<fileset dir="/var/www/myapp/log" id="deleteLogs">
<include name="**/debug*.log" />
</fileset>
<delete>
<fileset refid="deleteLogs" />
</delete>
</target>
我想添加类似
的内容<date datetime="xxxxxx" when="before"/>
或
<date seconds="xxxxxx" when="before"/>
仅删除超过5天的日志
如何在phing中构建xxxxx?
<tstamp>
不要返回“timestamp”: - /
答案 0 :(得分:1)
这是解决方案的提议
<?xml version="1.0" encoding="UTF-8"?>
<project name="Project" default="format" basedir=".">
<target name="format">
<tstamp>
<format property="DATE" pattern="%s" />
</tstamp>
<php expression="${DATE}-(3600*24*5)" returnProperty="NEWDATE"/>
<php expression="time()-(3600*24*5)" returnProperty="EVALUATEDTIME"/>
<echo>DATE = ${DATE}</echo>
<echo>NEWDATE = ${NEWDATE}</echo>
<echo>EVALUATEDTIME = ${EVALUATEDTIME}</echo>
</target>
</project>
实际上,您可以在eval中放置任何内容并直接计算您需要的任何内容。