svn: /web/doc-editor/trunk/php/ PreviewFile.php
| From: | Hannes Magnusson | Date: | Wed, 08 Jun 2011 19:18:39 +0000 |
| Subject: | svn: /web/doc-editor/trunk/php/ PreviewFile.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-2009@lists.php.net to get a copy of this message | ||
bjori Wed, 08 Jun 2011 19:18:39 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=311939
Log:
We are working on a .new file, which we need to rename temporary to get into the doc build
Changed paths:
U web/doc-editor/trunk/php/PreviewFile.php
Modified: web/doc-editor/trunk/php/PreviewFile.php
===================================================================
--- web/doc-editor/trunk/php/PreviewFile.php 2011-06-08 18:59:39 UTC (rev 311938)
+++ web/doc-editor/trunk/php/PreviewFile.php 2011-06-08 19:18:39 UTC (rev 311939)
@@ -34,10 +34,6 @@
$fullPath =
$appConf['GLOBAL_CONFIGURATION']['data.path'].$appConf[$project]['vcs.module'].'/'.$this->path;
- if( file_exists($fullPath.'.new') ) {
- $this->path = $this->path.'.new';
- }
-
}
private function checkDir()
@@ -69,9 +65,23 @@
$cmd = 'rm -R '.$this->outputDir.'* ;';
exec("$cmd");
+ $rename = 0;
+ $t = time();
+ // We are editing temporary file
+ if( file_exists($fullPath.'.new') ) {
+ $rename = 1;
+ rename($this->path, $this->path . $t);
+ rename($this->path .'.new', $this->path);
+ }
+
// We start the build for this file
$cmd = 'cd '.$appConf[$project]['vcs.path'].';
'.$appConf['GLOBAL_CONFIGURATION']['php.bin'].' doc-base/configure.php
--generate='.$this->path.' ;
'.$appConf['GLOBAL_CONFIGURATION']['php.bin'].' ../phd/render.php
--package PHP --format php --memoryindex -d doc-base/.manual.xml --output
'.$this->outputDir;
exec("$cmd");
+ // Rename it back
+ if ($rename) {
+ rename($this->path, $this->path . '.new');
+ rename($this->path . $t, $this->path);
+ }
$this->buildCmd = $cmd;