Skip to content

Commit

Permalink
Merge pull request aws#690 from afrowuk/master
Browse files Browse the repository at this point in the history
Suppress error from mkdir
  • Loading branch information
jeskew committed Jul 17, 2015
2 parents b5212b6 + 1bee4e0 commit 9db359f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/JsonCompiler.php
Expand Up @@ -32,16 +32,16 @@ public function __construct($useCache = true)
$this->cacheDir = getenv(self::CACHE_ENV)
?: sys_get_temp_dir() . '/aws-cache';

if (!is_dir($this->cacheDir)) {
if (!mkdir($this->cacheDir, 0777, true)) {
$message = 'Unable to create cache directory: %s. Please make '
. 'this directory writable or provide the path to a '
. 'writable directory using the AWS_PHP_CACHE_DIR '
. 'environment variable. Note that this cache dir may need '
. 'to be cleared when updating the SDK in order to see '
. 'updates.';
throw new \RuntimeException(sprintf($message, $this->cacheDir));
}
if (!is_dir($this->cacheDir)
&& !@mkdir($this->cacheDir, 0777, true)
&& !is_dir($this->cacheDir)) {
$message = 'Unable to create cache directory: %s. Please make '
. 'this directory writable or provide the path to a '
. 'writable directory using the AWS_PHP_CACHE_DIR '
. 'environment variable. Note that this cache dir may need '
. 'to be cleared when updating the SDK in order to see '
. 'updates.';
throw new \RuntimeException(sprintf($message, $this->cacheDir));
}
}

Expand Down

0 comments on commit 9db359f

Please sign in to comment.