cvs: php-gcov-web(SOC06) /www index.php
| From: | Nuno Lopes | Date: | Fri, 20 Oct 2006 22:10:27 +0000 |
| Subject: | cvs: php-gcov-web(SOC06) /www index.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-33121@lists.php.net to get a copy of this message | ||
nlopess Fri Oct 20 22:10:27 2006 UTC
Modified files: (Branch: SOC06)
/php-gcov-web/www index.php
Log:
build time estimated completion time (part #1).
Based on a patch by Daniel Pronych
http://cvs.php.net/viewvc.cgi/php-gcov-web/www/index.php?r1=1.1.2.13&r2=1.1.2.14&diff_format=u
Index: php-gcov-web/www/index.php
diff -u php-gcov-web/www/index.php:1.1.2.13 php-gcov-web/www/index.php:1.1.2.14
--- php-gcov-web/www/index.php:1.1.2.13 Sat Oct 7 18:08:05 2006
+++ php-gcov-web/www/index.php Fri Oct 20 22:10:27 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: index.php,v 1.1.2.13 2006/10/07 18:08:05 nlopess Exp $ */
+/* $Id: index.php,v 1.1.2.14 2006/10/20 22:10:27 nlopess Exp $ */
// Include the site API
include 'site.api.php';
@@ -61,6 +61,7 @@
<th>Last Attempted<br />Build Date</th>
<th>Last Successful<br />Build Date</th>
<th>Last Build <br /> Time</th>
+<th>Build Completion<br /> Estimate</th>
</tr>
<?php
@@ -74,7 +75,35 @@
echo
'<td>'.$version_last_attempted_build_date.'</td>'."\n";
echo
'<td>'.$version_last_successful_build_date.'</td>'."\n";
echo
'<td>'.time_diff($version_last_build_time).'</td>'."\n";
-
+
+ echo '<td>';
+
+ $pidfile = "./$version_name/build.pid";
+
+ if(@file_exists($pidfile) && posix_kill((int)@file_get_contents($pidfile), 0)) {
+
+ if($version_last_build_time > 0) {
+ // Obtain last modified date and time of the process id file
+ $estimate_time = filemtime($pidfile) + $version_last_build_time - time();
+
+ if($estimate_time <= 0) {
+ echo 'any time soon';
+ } else {
+ echo time_diff($estimate_time);
+ } // End check for a positive time estimation
+
+ // this is the first time the build is running
+ } else {
+ echo 'Unknown';
+ }
+
+ } else {
+ @unlink($pidfile);
+ echo 'Not running';
+ } // End check for a running php build process id
+
+ echo "</td>\n";
+
// End additions
echo "</tr>\n";
}