Modify

Ticket #255 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Timestamp in Phing Properties for Echo etc

Reported by: normk Owned by: 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

comment:1 Changed 4 years ago 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

comment:2 Changed 4 years ago 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!

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.