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 28, 2018
1 parent 1ab2c77 commit 3fce607
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ core_vendor=core/vendor

core_doc_files=AUTHORS COPYING README.md
core_src_files=$(wildcard *.php) index.html db_structure.xml .htaccess .user.ini
core_src_dirs=apps core l10n lib occ ocs ocs-provider resources settings
core_src_dirs=apps apps2 core l10n lib occ ocs ocs-provider resources settings
core_test_dirs=tests
core_all_src=$(core_src_files) $(core_src_dirs) $(core_doc_files)
dist_dir=build/dist
Expand Down Expand Up @@ -230,7 +230,7 @@ $(dist_dir)/owncloud: $(composer_deps) $(nodejs_deps) $(core_all_src)
rm -Rf $@/settings/tests
rm -Rf $@/core/vendor/*/{.bower.json,bower.json,package.json,testem.json}
find $@/{core/,l10n/} -iname \*.sh -delete
find $@/{apps/,lib/composer/,core/vendor/} \( \
find $@/{apps/,apps2/,lib/composer/,core/vendor/} \( \
-name bin -o \
-name test -o \
-name tests -o \
Expand All @@ -241,7 +241,7 @@ $(dist_dir)/owncloud: $(composer_deps) $(nodejs_deps) $(core_all_src)
-name travis -o \
-iname \*.sh \
\) -print | xargs rm -Rf
find $@/{apps/,lib/composer/} -iname \*.exe -delete
find $@/{apps/,apps2/,lib/composer/} -iname \*.exe -delete
# Set build
$(eval _BUILD="$(shell date -u --iso-8601=seconds) $(shell git rev-parse HEAD)")
# Replace channel in version.php
Expand Down Expand Up @@ -280,7 +280,7 @@ $(dist_dir)/qa/owncloud: $(composer_dev_deps) $(nodejs_deps) $(core_all_src) $(c
find $@ -name no-php -delete
rm -Rf $@/core/vendor/*/{.bower.json,bower.json,package.json,testem.json}
find $@/{core/,l10n/} -iname \*.sh -delete
find $@/{apps/,lib/composer/,core/vendor/} \( \
find $@/{apps/,apps2/,lib/composer/,core/vendor/} \( \
-name test -o \
-name examples -o \
-name demo -o \
Expand All @@ -289,7 +289,7 @@ $(dist_dir)/qa/owncloud: $(composer_dev_deps) $(nodejs_deps) $(core_all_src) $(c
-name travis -o \
-iname \*.sh \
\) -print | xargs rm -Rf
find $@/{apps/,lib/composer/} -iname \*.exe -delete
find $@/{apps/,apps2/,lib/composer/} -iname \*.exe -delete
# Set build
$(eval _BUILD="$(shell date -u --iso-8601=seconds) $(shell git rev-parse HEAD)")
# Replace channel in version.php
Expand Down
Empty file added apps2/.gitkeep
Empty file.
32 changes: 30 additions & 2 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,43 @@ 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 using apps_path
$apps2Key = \OC::$server->getSystemConfig()->getValue('apps_paths', false);

// add the key only if it does not exist (protect for possible overwriting)
if ($apps2Key === false) {
$appsDir = \OC::$SERVERROOT . '/apps';
$apps2Dir = \OC::$SERVERROOT . '/apps2';

$defaultAppsPaths = array(
'apps_path' => array(
0 => array(
"path" => $appsDir,
"url" => "/apps",
"writable" => "false"
),
1 => array(
"path" => $apps2Dir,
"url" => "/apps2",
"writable" => "true"
)
)
);

$config->setSystemValues($defaultAppsPaths);
}

// finished initial setup

}

return $error;
Expand Down

0 comments on commit 3fce607

Please sign in to comment.