2012-10-27 05:22:00 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2012-10-27 05:22:00 -04:00
|
|
|
/**
|
2025-06-10 05:49:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2025 Nextcloud GmbH and Nextcloud contributors
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2012-2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2012-10-27 05:22:00 -04:00
|
|
|
*/
|
|
|
|
|
|
2025-07-29 11:29:30 -04:00
|
|
|
use OC\Installer;
|
|
|
|
|
use OCP\App\IAppManager;
|
|
|
|
|
use OCP\Server;
|
|
|
|
|
|
2024-09-19 05:10:31 -04:00
|
|
|
require_once __DIR__ . '/../lib/base.php';
|
2012-10-27 05:22:00 -04:00
|
|
|
|
2014-01-15 11:12:42 -05:00
|
|
|
function enableApp($app) {
|
2025-07-29 11:29:30 -04:00
|
|
|
$installer = Server::get(Installer::class);
|
|
|
|
|
$appManager = Server::get(IAppManager::class);
|
|
|
|
|
|
|
|
|
|
$installer->installApp($app);
|
|
|
|
|
$appManager->enableApp($app);
|
2025-06-10 06:05:12 -04:00
|
|
|
echo "Enabled application {$app}\n";
|
2014-01-15 11:12:42 -05:00
|
|
|
}
|
|
|
|
|
|
2025-05-23 14:11:56 -04:00
|
|
|
foreach (new \DirectoryIterator(__DIR__ . '/../apps/') as $file) {
|
|
|
|
|
if ($file->isDot()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (!file_exists($file->getPathname() . '/.git')) {
|
|
|
|
|
enableApp($file->getFilename());
|
|
|
|
|
}
|
|
|
|
|
}
|