|
|
|
@ -46,8 +46,8 @@ use OC\App\AppStore\Fetcher\AppFetcher; |
|
|
|
use OC\AppFramework\Bootstrap\Coordinator; |
|
|
|
use OC\Archive\TAR; |
|
|
|
use OC\DB\Connection; |
|
|
|
use OC\DB\MigrationService; |
|
|
|
use OC_App; |
|
|
|
use OC_DB; |
|
|
|
use OC_Helper; |
|
|
|
use OCP\Http\Client\IClientService; |
|
|
|
use OCP\IConfig; |
|
|
|
@ -114,6 +114,11 @@ class Installer { |
|
|
|
} |
|
|
|
|
|
|
|
$basedir = $app['path'].'/'.$appId; |
|
|
|
|
|
|
|
if (is_file($basedir . '/appinfo/database.xml')) { |
|
|
|
throw new \Exception('The appinfo/database.xml file is not longer supported. Used in ' . $appId); |
|
|
|
} |
|
|
|
|
|
|
|
$info = OC_App::getAppInfo($basedir.'/appinfo/info.xml', true); |
|
|
|
|
|
|
|
$l = \OC::$server->getL10N('core'); |
|
|
|
@ -152,16 +157,9 @@ class Installer { |
|
|
|
} |
|
|
|
|
|
|
|
//install the database
|
|
|
|
if (is_file($basedir.'/appinfo/database.xml')) { |
|
|
|
if (\OC::$server->getConfig()->getAppValue($info['id'], 'installed_version') === null) { |
|
|
|
OC_DB::createDbFromStructure($basedir.'/appinfo/database.xml'); |
|
|
|
} else { |
|
|
|
OC_DB::updateDbFromStructure($basedir.'/appinfo/database.xml'); |
|
|
|
} |
|
|
|
} else { |
|
|
|
$ms = new \OC\DB\MigrationService($info['id'], \OC::$server->get(Connection::class)); |
|
|
|
$ms->migrate('latest', true); |
|
|
|
} |
|
|
|
$ms = new MigrationService($info['id'], \OC::$server->get(Connection::class)); |
|
|
|
$ms->migrate('latest', true); |
|
|
|
|
|
|
|
if ($previousVersion) { |
|
|
|
OC_App::executeRepairSteps($appId, $info['repair-steps']['post-migration']); |
|
|
|
} |
|
|
|
@ -601,20 +599,8 @@ class Installer { |
|
|
|
$appPath = OC_App::getAppPath($app); |
|
|
|
\OC_App::registerAutoloading($app, $appPath); |
|
|
|
|
|
|
|
if (is_file("$appPath/appinfo/database.xml")) { |
|
|
|
try { |
|
|
|
OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); |
|
|
|
} catch (TableExistsException $e) { |
|
|
|
throw new HintException( |
|
|
|
'Failed to enable app ' . $app, |
|
|
|
'Please ask for help via one of our <a href="https://nextcloud.com/support/" target="_blank" rel="noreferrer noopener">support channels</a>.', |
|
|
|
0, $e |
|
|
|
); |
|
|
|
} |
|
|
|
} else { |
|
|
|
$ms = new \OC\DB\MigrationService($app, \OC::$server->get(Connection::class)); |
|
|
|
$ms->migrate('latest', true); |
|
|
|
} |
|
|
|
$ms = new MigrationService($app, \OC::$server->get(Connection::class)); |
|
|
|
$ms->migrate('latest', true); |
|
|
|
|
|
|
|
//run appinfo/install.php
|
|
|
|
self::includeAppScript("$appPath/appinfo/install.php"); |
|
|
|
|