svn: /phpdoc/doc-base/trunk/scripts/ build-chms.php
| From: | Richard Quadling | Date: | Mon, 16 May 2011 11:22:31 +0000 |
| Subject: | svn: /phpdoc/doc-base/trunk/scripts/ build-chms.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8105@lists.php.net to get a copy of this message | ||
rquadling Mon, 16 May 2011 11:22:31 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=311074
Log:
Export this build's history to a file in the same directory as all the compiled CHM files.
Changed paths:
U phpdoc/doc-base/trunk/scripts/build-chms.php
Modified: phpdoc/doc-base/trunk/scripts/build-chms.php
===================================================================
--- phpdoc/doc-base/trunk/scripts/build-chms.php 2011-05-16 10:41:54 UTC (rev 311073)
+++ phpdoc/doc-base/trunk/scripts/build-chms.php 2011-05-16 11:22:31 UTC (rev 311074)
@@ -101,6 +101,11 @@
}
/**
+ * Hold the results of this build
+ */
+ $a_BuildHistory = array();
+
+ /**
* Start iterating over each translation
*/
foreach($languages as $lang)
@@ -165,11 +170,16 @@
/**
* Copy the CHM file into the archive
*/
- if(!copy(PATH_DOC . '\\tmp\\' . $lang . '\\php-chm\\php_manual_' . $lang .
'.chm', PATH_DOC . '\\chmfiles\\php_manual_' . $lang . '.chm'))
+ if(!copy(PATH_DOC . '\\tmp\\' . $lang . '\\php-chm\\php_manual_' . $lang .
'.chm', $s_CHMFilename = PATH_DOC . '\\chmfiles\\php_manual_' . $lang .
'.chm'))
{
echo(date('r') . ' - Build error: Unable to copy CHM file into archive
folder');
continue;
+ } else {
+ /**
+ * Add to history
+ */
+ $a_BuildHistory[] = array('php_manual_' . $lang . '.chm',
md5_file($s_CHMFilename), filemtime($s_CHMFilename));
}
/**
@@ -221,11 +231,16 @@
/**
* Copy the CHM file into the archive
*/
- if(!copy(PATH_DOC . '\\tmp\\' . $lang . '\\php-enhancedchm\\php_manual_' .
$lang . '.chm', PATH_DOC . '\\chmfiles\\php_enhanced_' . $lang .
'.chm'))
+ if(!copy(PATH_DOC . '\\tmp\\' . $lang . '\\php-enhancedchm\\php_manual_' .
$lang . '.chm', $s_CHMFilename = PATH_DOC . '\\chmfiles\\php_enhanced_' . $lang
. '.chm'))
{
echo(date('r') . ' - Build error: Enhanced: Unable to copy CHM file into archive
folder');
goto cleanup;
+ } else {
+ /**
+ * Add to history
+ */
+ $a_BuildHistory[] = array('php_enhanced_' . $lang . '.chm',
md5_file($s_CHMFilename), filemtime($s_CHMFilename));
}
/**
@@ -255,6 +270,12 @@
}
}
+
+ /**
+ * Save build history
+ */
+ file_put_contents(PATH_DOC . '\\chmfiles\\LatestCHMBuilds.txt', implode(PHP_EOL,
array_map(function($a_SingleBuild){ return implode("\t", $a_SingleBuild);},
$a_BuildHistory)));
+
echo(date('r') . ' Done!');