Skip to content

Commit

Permalink
Add missing docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Nov 19, 2014
1 parent 90f8211 commit d69cad4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
34 changes: 21 additions & 13 deletions src/Cli/Process.php
Expand Up @@ -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;
}

}#
2 changes: 2 additions & 0 deletions src/ClientSide/Compiler.php
@@ -1,5 +1,7 @@
<?php
/**
* Provides a standard interface for compiling client-side scripts such as
* pre-processed Style Sheets or JavaScript.
*
* PHP.Gt (http://php.gt)
* @copyright Copyright Ⓒ 2014 Bright Flair Ltd. (http://brightflair.com)
Expand Down
14 changes: 12 additions & 2 deletions src/ClientSide/FileOrganiser.php
@@ -1,5 +1,8 @@
<?php
/**
* Responsible for maintaining the organisation of the public web root (www)
* directory and the contents and cache validity of the client-side files that
* are copied there.
*
* PHP.Gt (http://php.gt)
* @copyright Copyright Ⓒ 2014 Bright Flair Ltd. (http://brightflair.com)
Expand All @@ -20,6 +23,12 @@ class FileOrganiser {

private $staticFingerprintFile;

/**
* @param \Gt\Response\Response $response The object representing the current
* Page or Api response
* @param \Gt\ClientSide\Manifest $manifest The representation of the current
* response's public ststic files
*/
public function __construct($response, Manifest $manifest) {
$this->response = $response;
$this->manifest = $manifest;
Expand All @@ -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)) {
Expand Down Expand Up @@ -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([
Expand Down

0 comments on commit d69cad4

Please sign in to comment.