Skip to content

Commit

Permalink
Add per default the apps2 directory in config.php during installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattel committed Mar 23, 2018
1 parent 1ab2c77 commit f43a88d
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,49 @@ public function install($options) {
Setup::updateHtaccess();
Setup::protectDataDirectory();

//try to write logtimezone
// try to write logtimezone
if (date_default_timezone_get()) {
$config->setSystemValue('logtimezone', date_default_timezone_get());
}

self::installBackgroundJobs();

//and we are done
$config->setSystemValue('installed', true);

// adding the apps2 directory by default
$appsDir = \OC::$SERVERROOT . '/apps';
$apps2Dir = \OC::$SERVERROOT . '/apps2';
$apps2Exists = (file_exists($apps2Dir) || is_link($apps2Dir));
(bool)$apps2Key = \OC::$server->getSystemConfig()->getValue('apps_paths', false);

// try to create the apps2 directory
// should already be done by the presetup scrips (see documentation)
if (!$apps2Exists) {
@mkdir($apps2Dir);
}

// add the key only of not existent (protect possible overwriting)
if (!$apps2Key) {
$z = array(
'apps_path' => array(
0 => array(
"path" => $appsDir,
"url" => "/apps",
"writable" => "false"
),
1 => array(
"path" => $apps2Dir,
"url" => "/apps2",
"writable" => "true"
)
)
);

$config->setSystemValues($z);
}

// finished initial setup

}

return $error;
Expand Down

0 comments on commit f43a88d

Please sign in to comment.