summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-07-07 14:10:32 +0200
committerGitHub <noreply@github.com>2017-07-07 14:10:32 +0200
commite76b867c2c4704e6c760b80bcb9ac1354c29f54e (patch)
treeaef0b7bbd2a882c397ad10ebf01204f9f79e5572 /lib
parentc2ba5e2884cad679d8d02dfe7976401c3b03e9ee (diff)
parent79d7c26b8a7c5ed99f5002163343132302d70111 (diff)
downloadnextcloud-server-e76b867c2c4704e6c760b80bcb9ac1354c29f54e.tar.gz
nextcloud-server-e76b867c2c4704e6c760b80bcb9ac1354c29f54e.zip
Merge pull request #5628 from nextcloud/only-create-the-migration-dir-when-necessary
Only create the migration directory when necessary
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/MigrationService.php13
-rw-r--r--lib/private/Installer.php2
2 files changed, 5 insertions, 10 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index a4276b08c12..92041b5e324 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -25,7 +25,6 @@
namespace OC\DB;
-use Doctrine\DBAL\Schema\Schema;
use OC\IntegrityCheck\Helpers\AppLocator;
use OC\Migration\SimpleOutput;
use OCP\AppFramework\App;
@@ -78,14 +77,6 @@ class MigrationService {
$namespace = App::buildAppNamespace($appName);
$this->migrationsPath = "$appPath/lib/Migration";
$this->migrationsNamespace = $namespace . '\\Migration';
-
- if (!@mkdir($appPath . '/lib') && !is_dir($appPath . '/lib')) {
- throw new \RuntimeException("Could not create migration folder \"{$this->migrationsPath}\"");
- }
- }
-
- if (!@mkdir($this->migrationsPath) && !is_dir($this->migrationsPath)) {
- throw new \RuntimeException("Could not create migration folder \"{$this->migrationsPath}\"");
}
}
@@ -164,6 +155,10 @@ class MigrationService {
protected function findMigrations() {
$directory = realpath($this->migrationsPath);
+ if (!file_exists($directory) || !is_dir($directory)) {
+ return [];
+ }
+
$iterator = new \RegexIterator(
new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS),
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 60b0336fb5a..4d7e5016653 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -131,6 +131,7 @@ class Installer {
// check for required dependencies
\OC_App::checkAppDependencies($this->config, $l, $info);
+ \OC_App::registerAutoloading($appId, $basedir);
//install the database
if(is_file($basedir.'/appinfo/database.xml')) {
@@ -144,7 +145,6 @@ class Installer {
$ms->migrate();
}
- \OC_App::registerAutoloading($appId, $basedir);
\OC_App::setupBackgroundJobs($info['background-jobs']);
if(isset($info['settings']) && is_array($info['settings'])) {
\OC::$server->getSettingsManager()->setupSettings($info['settings']);