/
HordeReconfigureCommand.php
42 lines (39 loc) · 1.75 KB
/
HordeReconfigureCommand.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types = 1);
namespace Horde\Composer;
use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Command\BaseCommand;
use Composer\InstalledVersions;
class HordeReconfigureCommand extends BaseCommand
{
protected function configure()
{
$this->setName('horde-reconfigure');
$this->setDescription('Rewrite autogenerated configuration');
$this->setHelp(
<<<EOT
Horde Installer writes various symlinks and files with installation specific paths.
If you move your installation around or manually tinker with local files, you may need to re-run this.
EOT
);
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
// Get installed packages of types handled by installer
$hordeApps = InstalledVersions::getInstalledPackagesByType('horde-application');
$hordeLibraries = InstalledVersions::getInstalledPackagesByType('horde-library');
$hordeThemes = InstalledVersions::getInstalledPackagesByType('horde-theme');
$composer = $this->getComposer();
$rootPackage = $composer->getPackage();
$rootPackageDir = dirname($composer->getConfig()->get('vendor-dir'));
$output->writeln('Applying /presets for absent files in /var/config');
$output->writeln('Looking for registry snippets from apps');
$output->writeln('Writing app configs to /var/config dir');
$output->writeln('Linking app configs to /web Dir');
$output->writeln('Linking javascript tree to /web/js');
$output->writeln('Linking themes tree to /web/themes');
return 0;
}
}