CRM_Core_Config - Display warning when mkdir fails
authorTim Otten <totten@civicrm.org>
Thu, 4 Feb 2016 03:16:20 +0000 (20:16 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 4 Feb 2016 03:16:20 +0000 (20:16 -0700)
CRM/Core/Config/MagicMerge.php

index b4282b657ddd2d410de1264976e357076cbcdea1..d4bc55978b7331f6aa3dbe158a1d4c80c5fc29ba 100644 (file)
@@ -225,7 +225,12 @@ class CRM_Core_Config_MagicMerge {
         if ($value) {
           $value = CRM_Utils_File::addTrailingSlash($value);
           if (isset($this->map[$k][2]) && in_array('mkdir', $this->map[$k][2])) {
-            CRM_Utils_File::createDir($value);
+            if (!CRM_Utils_File::createDir($value, FALSE)) {
+              CRM_Core_Session::setStatus(ts('Failed to make directory (%1) at "%2". Please update the settings or file permissions.', array(
+                1 => $k,
+                2 => $value,
+              )));
+            }
           }
           if (isset($this->map[$k][2]) && in_array('restrict', $this->map[$k][2])) {
             CRM_Utils_File::restrictAccess($value);