]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not add apps2/ directory if it does not exist
authorJoas Schilling <nickvergessen@owncloud.com>
Thu, 19 Mar 2015 08:07:29 +0000 (09:07 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Thu, 19 Mar 2015 08:07:29 +0000 (09:07 +0100)
tests/preseed-config.php

index 3f41573bf2954478b6d34bdb3ecc3750a3a7be53..e2c5a55fa58fb633f592539c878451a80cbbeeb4 100644 (file)
@@ -1,23 +1,23 @@
 <?php
-$CONFIG = array (
-       "appstoreenabled" => false,
-       'apps_paths' =>
-               array (
-                       0 =>
-                               array (
-                                       'path' => OC::$SERVERROOT.'/apps',
-                                       'url' => '/apps',
-                                       'writable' => true,
-                               ),
-                       1 =>
-                               array (
-                                       'path' => OC::$SERVERROOT.'/apps2',
-                                       'url' => '/apps2',
-                                       'writable' => false,
-                               )
-               ),
-);
+$CONFIG = [
+       'appstoreenabled' => false,
+       'apps_paths' => [
+               [
+                       'path'          => OC::$SERVERROOT . '/apps',
+                       'url'           => '/apps',
+                       'writable'      => true,
+               ],
+       ],
+];
 
-if(substr(strtolower(PHP_OS), 0, 3) == "win") {
-       $CONFIG['openssl'] = array( 'config' => OC::$SERVERROOT.'/tests/data/openssl.cnf');
+if (is_dir(OC::$SERVERROOT.'/apps2')) {
+       $CONFIG['apps_paths'][] = [
+               'path' => OC::$SERVERROOT . '/apps2',
+               'url' => '/apps2',
+               'writable' => false,
+       ];
+}
+
+if (substr(strtolower(PHP_OS), 0, 3) === 'win') {
+       $CONFIG['openssl'] = ['config' => OC::$SERVERROOT . '/tests/data/openssl.cnf'];
 }