From 8203af018223e46db46bc23c3a6006f0ea34890c Mon Sep 17 00:00:00 2001
From: Laurent Giovannoni <laurent.giovannoni@maarch.org>
Date: Mon, 8 Apr 2013 15:57:53 +0000
Subject: [PATCH] evo: add index dir creation

---
 core/trunk/install/class/Class_Install.php | 52 +++++++++++++++++++++-
 1 file changed, 50 insertions(+), 2 deletions(-)

diff --git a/core/trunk/install/class/Class_Install.php b/core/trunk/install/class/Class_Install.php
index 5d4c6d6cc4b..bfc1229b0ab 100755
--- a/core/trunk/install/class/Class_Install.php
+++ b/core/trunk/install/class/Class_Install.php
@@ -455,16 +455,64 @@ class Install extends functions
         for ($i=0;$i<count($this->docservers);$i++) {
             if (!is_dir(
                 $docserverPath . DIRECTORY_SEPARATOR
-                . $this->docservers[$i][1])
+                    . $this->docservers[$i][1])
             ) {
                 if (!mkdir(
                     $docserverPath . DIRECTORY_SEPARATOR
-                    . $this->docservers[$i][1])
+                        . $this->docservers[$i][1])
                 ) {
                     return false;
                 }
             }
         }
+        //create indexes dir
+        if (!is_dir(
+            $docserverPath . DIRECTORY_SEPARATOR
+                . 'indexes')
+        ) {
+            if (!mkdir(
+                $docserverPath . DIRECTORY_SEPARATOR
+                    . 'indexes')
+            ) {
+                return false;
+            }
+        }
+        //create indexes dir for letterbox collection
+        if (!is_dir(
+            $docserverPath . DIRECTORY_SEPARATOR
+                . 'indexes' . DIRECTORY_SEPARATOR . 'letterbox_coll')
+        ) {
+            if (!mkdir(
+                $docserverPath . DIRECTORY_SEPARATOR
+                    . 'indexes' . DIRECTORY_SEPARATOR . 'letterbox_coll')
+            ) {
+                return false;
+            }
+        }
+        //create indexes dir for business collection
+        if (!is_dir(
+            $docserverPath . DIRECTORY_SEPARATOR
+                . 'indexes' . DIRECTORY_SEPARATOR . 'business_coll')
+        ) {
+            if (!mkdir(
+                $docserverPath . DIRECTORY_SEPARATOR
+                    . 'indexes' . DIRECTORY_SEPARATOR . 'business_coll')
+            ) {
+                return false;
+            }
+        }
+        //create indexes dir for cold collection
+        if (!is_dir(
+            $docserverPath . DIRECTORY_SEPARATOR
+                . 'indexes' . DIRECTORY_SEPARATOR . 'res_coll')
+        ) {
+            if (!mkdir(
+                $docserverPath . DIRECTORY_SEPARATOR
+                    . 'indexes' . DIRECTORY_SEPARATOR . 'res_coll')
+            ) {
+                return false;
+            }
+        }
         return true;
     }
 
-- 
GitLab