svn: /web/doc-editor/trunk/php/ PreviewFile.php

From: Date: Wed, 08 Jun 2011 18:59:39 +0000
Subject: svn: /web/doc-editor/trunk/php/ PreviewFile.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-2008@lists.php.net to get a copy of this message
bjori Wed, 08 Jun 2011 18:59:39 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=311938 Log: - Only move the specific file we want to preview - Use in-memory indexing for PhD - set the move command as a property for debugging 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:58:23 UTC (rev 311937) +++ web/doc-editor/trunk/php/PreviewFile.php 2011-06-08 18:59:39 UTC (rev 311938) @@ -70,20 +70,24 @@ exec("$cmd"); // 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 -d doc-base/.manual.xml --output '.$this->outputDir; + $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"); $this->buildCmd = $cmd; - // We move the result into preview.baseURI - $cmd = 'mv '.$this->outputDir.'php-web/*.php '.$this->inputDir; + // Only move the specific file we are generating + $xmlID = $this->getOutputId(); + $filename = 'phdoe-' . time() . '-' . $xmlID. '.php'; + $cmd = 'mv '.$this->outputDir.'php-web/'.$xmlID.'.php '.$this->inputDir. $filename; exec("$cmd"); + $this->moveCmd = $cmd; - $this->getOutputFileName(); + $this->previewUrl = $this->am->appConf[$this->am->project]['preview.baseURI'].'manual/en/' . $filename; + } - private function getOutputFileName() + private function getOutputId() { // The output file name is the first ID of the file $file = explode('/', $this->path); @@ -96,8 +100,7 @@ $xmlIDs = explode('|',$info['xmlid']); $xmlID = $xmlIDs[0]; - - $this->previewUrl = $this->am->appConf[$this->am->project]['preview.baseURI'].'manual/en/'.$xmlID.'.php'; + return $xmlID; } public function getPreviewUrl() {

« previous php.doc.web (#2008) next »