From d69cad443ac807eae7e4275b920b9887a03c2eab Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 19 Nov 2014 09:53:30 +0000 Subject: [PATCH] Add missing docblocks --- src/Cli/Process.php | 34 ++++++++++++++++++++------------ src/ClientSide/Compiler.php | 2 ++ src/ClientSide/FileOrganiser.php | 14 +++++++++++-- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/Cli/Process.php b/src/Cli/Process.php index 8043adad..3e746f56 100644 --- a/src/Cli/Process.php +++ b/src/Cli/Process.php @@ -36,22 +36,30 @@ public function __destruct() { } } +/** + * Spawns a new process and writes the process's output to STDOUT. + * + * @param bool $dummyRun Defaults to false. Set to true to skip opening of the + * new process and instead just return the process string + * + * @return string The exact string executed on the system + */ public function run($dummyRun = false) { - if($dummyRun) { - return $this->processString; - } - - $this->fp = popen( - $this->processString - // Redirect STDOUT to this process's STDIN. - . " 1>&0", - "r" - ); + if(!$dummyRun) { + $this->fp = popen( + $this->processString + // Redirect STDOUT to this process's STDIN. + . " 1>&0", + "r" + ); - // Pass back all output from newly-spawned process. - while(false !== ($s = fread($this->fp, 1024)) ) { - fwrite(STDOUT, $s); + // Pass back all output from newly-spawned process. + while(false !== ($s = fread($this->fp, 1024)) ) { + fwrite(STDOUT, $s); + } } + + return $this->processString; } }# \ No newline at end of file diff --git a/src/ClientSide/Compiler.php b/src/ClientSide/Compiler.php index f9bb3d91..8467339e 100644 --- a/src/ClientSide/Compiler.php +++ b/src/ClientSide/Compiler.php @@ -1,5 +1,7 @@ response = $response; $this->manifest = $manifest; @@ -44,7 +53,6 @@ public function organise($pathDetails = []) { $copyCount = 0; $staticValid = true; - // Performing the 10 steps as described here: // http://php.gt/docs/static-file-fingerprinting if(!file_exists($this->staticFingerprintFile)) { @@ -78,7 +86,9 @@ public function organise($pathDetails = []) { } /** - * + * Recurses over the source directories containing static files, providing an + * MD5 hash of the contents and writes it to a special file inside the + * public web root. */ public function createStaticFingerprint() { $staticSrcFingerprint = $this->recursiveFingerprint([