Ticket #255 (closed enhancement: fixed)

Opened 7 months ago

Last modified 5 months ago

Timestamp in Phing Properties for Echo etc

Reported by: normk Assigned to: hans
Priority: minor Milestone: 2.3.1
Component: phing-core Version: 2.3.1RC1
Keywords: timestamp, echo Cc:

Description

Feature request: If possible, provide a timestamp, i.e., formatted Date/Time stamp in phing built in properties for display in <echo> task. This will provide a checkpoint for an appended log file that you can use when you run phing from CRON and >> log.txt.

For instance, add phing.startTime formatted as standard date/time format in current locale so you can <echo msg="Phing started at ${phing.startTime}" />

I don't really need xinc or cc so I run my nightly phing build from cron and redirect the output to a log file instead of picking up the *nix mail. Using >>, I append each cron run to the log file and examine it periodically.

Thanks for considering this!

Attachments

Change History

06/19/08 22:09:21 changed by normk

Tested this suggested patch to Phing.php. Not sure if it's in the most appropriate place but it makes sense.

After line 1079: self::setProperty('application.startdir', getcwd());

Add: self::setProperty('phing.startTime', gmdate('D, d M Y H:i:s', time()) . ' GMT');

Tested with this xml build file: <?xml version="1.0"?> <project name="FooBar" default="dist" basedir=".">

<target name="checkout" >

<echo msg="Phing started on ${phing.startTime}" />

</target>

</project>

Output:
[echo] Phing started on Thu, 19 Jun 2008 22:08:00 GMT

07/29/08 16:02:47 changed by mrook

  • status changed from new to closed.
  • resolution set to fixed.

This bug has been fixed in the SVN tree, revision r379.

Thank you for the report, and for helping us make Phing better!


Add/Change #255 (Timestamp in Phing Properties for Echo etc)




Action