From 5f9c8fdec4e345af3f8ac2cf7ca3dce4ad702030 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Tue, 29 Jan 2013 13:08:52 +0000
Subject: [PATCH] Issue #1885796 by sun: Fixed PHP warnings in
 PhpStorage\FileStorage::save().

---
 core/lib/Drupal/Component/PhpStorage/FileStorage.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/lib/Drupal/Component/PhpStorage/FileStorage.php b/core/lib/Drupal/Component/PhpStorage/FileStorage.php
index b8c3aad042dd..d588af4780cc 100644
--- a/core/lib/Drupal/Component/PhpStorage/FileStorage.php
+++ b/core/lib/Drupal/Component/PhpStorage/FileStorage.php
@@ -53,7 +53,10 @@ public function load($name) {
    */
   public function save($name, $code) {
     $path = $this->getFullPath($name);
-    mkdir(dirname($path), 0700, TRUE);
+    $dir = dirname($path);
+    if (!file_exists($dir)) {
+      mkdir($dir, 0700, TRUE);
+    }
     return (bool) file_put_contents($path, $code);
   }
 
-- 
GitLab