Skip to content

Commit

Permalink
[HttpKernel] Removed calls to undefined variable + added check on mkd…
Browse files Browse the repository at this point in the history
…ir in save method
  • Loading branch information
jeromemacias authored and fabpot committed Jan 25, 2011
1 parent a4de7da commit b325487
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpKernel/Cache/Store.php
Expand Up @@ -151,7 +151,7 @@ public function write(Request $request, Response $response)
$digest = 'en'.sha1($response->getContent());

if (false === $this->save($digest, $response->getContent())) {
throw new \RuntimeException(sprintf('Unable to store the entity (%s).', $e->getMessage()));
throw new \RuntimeException(sprintf('Unable to store the entity.'));
}

$response->headers->set('X-Content-Digest', $digest);
Expand Down Expand Up @@ -180,7 +180,7 @@ public function write(Request $request, Response $response)
array_unshift($entries, array($storedEnv, $headers));

if (false === $this->save($key, serialize($entries))) {
throw new \RuntimeException(sprintf('Unable to store the metadata (%s).', $e->getMessage()));
throw new \RuntimeException(sprintf('Unable to store the metadata.'));
}

return $key;
Expand Down Expand Up @@ -315,8 +315,8 @@ public function load($key)
public function save($key, $data)
{
$path = $this->getPath($key);
if (!is_dir(dirname($path))) {
mkdir(dirname($path), 0777, true);
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
return false;
}

$tmpFile = tempnam(dirname($path), basename($path));
Expand Down

0 comments on commit b325487

Please sign in to comment.