Installs the shop files.

@param \Composer\Script\Event $event Event instance
@throws \RuntimeException If an error occured
12034
public static function install( \Composer\Script\Event $event )
	{
		$repository = $event->getComposer()->getRepositoryManager()->getLocalRepository();

		if( ( $t3package = $repository->findPackage( 'aimeos/aimeos-typo3', '*' ) ) === null
			&& ( $t3package = $repository->findPackage( 'typo3-ter/aimeos-typo3', '*' ) ) === null
		) {
			throw new \RuntimeException( 'No installed package "aimeos/aimeos-typo3" or "typo3-ter/aimeos-typo3" found' );
		}

		$installer = $event->getComposer()->getInstallationManager();
		$t3path = $installer->getInstallPath( $t3package );

		if( ( $package = $repository->findPackage( 'aimeos/ai-client-html', '*' ) ) !== null )
		{
			$event->getIO()->write( 'Installing Aimeos public files from HTML client' );

			$path = $installer->getInstallPath( $package );
			self::copyRecursive( $path . '/client/html/themes', $t3path . '/Resources/Public/Themes' );
		}

		if( ( $package = $repository->findPackage( 'aimeos/ai-typo3', '*' ) ) !== null )
		{
			$event->getIO()->write( 'Creating symlink to Aimeos extension directory' );

			$path = dirname( $installer->getInstallPath( $package ) );
			self::createLink( '../../../../../../' . $path, $t3path . '/Resources/Private/Extensions' );
		}
	}
510188
public static function postAutoloadDump(Event $event)
    {
        $composer = $event->getComposer();
        $config = $composer->getConfig();

        $vendorDir = realpath($config->get('vendor-dir'));

        $packages = $composer->getRepositoryManager()->getLocalRepository()->getPackages();
        $pluginsDir = dirname($vendorDir) . DIRECTORY_SEPARATOR . 'plugins';

        $plugins = static::determinePlugins($packages, $pluginsDir, $vendorDir);

        $configFile = static::configFile($vendorDir);
        static::writeConfigFile($configFile, $plugins);
    }
364552
public function onPostAutoloadDump(Event $event) {
    $args = $event->isDevMode() ? '' : ' --no-dev';
    $finder = new ExecutableFinder();
    $hhvm = $finder->find('hhvm', 'hhvm');
    $executor = new ProcessExecutor($this->io);
    $command = $hhvm . ' ' . ProcessExecutor::escape($this->vendor.'/bin/hh-autoload.hack') . $args;
    $executor->execute($command);
  }
974548
public static function buildBootstrap(Event $event)
    {
        $options = static::getOptions($event);
        $bootstrapDir = $autoloadDir = $options['symfony-app-dir'];

        if (static::useNewDirectoryStructure($options)) {
            $bootstrapDir = $options['symfony-var-dir'];
            if (!static::hasDirectory($event, 'symfony-var-dir', $bootstrapDir, 'build bootstrap file')) {
                return;
            }
        }

        if (!static::useSymfonyAutoloader($options)) {
            $autoloadDir = $options['vendor-dir'];
        }

        if (!static::hasDirectory($event, 'symfony-app-dir', $autoloadDir, 'build bootstrap file')) {
            return;
        }

        static::executeBuildBootstrap($event, $bootstrapDir, $autoloadDir, $options['process-timeout']);
    }
452448
public static function handle(PackageEvent $event)
    {
        $operation = $event->getOperation();
        if ($operation instanceof InstallOperation) {
            $package = $operation->getPackage();
        } elseif ($operation instanceof UpdateOperation) {
            $package = $operation->getTargetPackage();
        } else {
            return;
        }

        $extra = $package->getExtra();
        if ($package->getType() !== 'bolt-extension' || !isset($extra['bolt-assets'])) {
            return;
        }

        $rootExtra = $event->getComposer()->getPackage()->getExtra();
        if (realpath($rootExtra['bolt-web-path']) === realpath($rootExtra['bolt-root-path'])) {
            return;
        }

        // Copy package assets to main web path
        $src = 'vendor/' . $package->getName() . '/' . $extra['bolt-assets'];
        $dest = $rootExtra['bolt-web-path'] . '/extensions/vendor/' . $package->getName();

        self::mirror($src, $dest, $event);
    }
1128349
public static function importRoutes(Event $event) {
        $options = self::getOptions($event);
        $appDir = $options['symfony-app-dir'];
        $webDir = $options['symfony-web-dir'];

        if (!is_dir($webDir)) {
            echo 'The symfony-web-dir (' . $webDir . ') specified in composer.json was not found in ' . getcwd() . ', can not install assets.' . PHP_EOL;

            return;
        }

        static::executeCommand($event, $appDir, 'wucdbm_menu_builder:import_routes');
    }
1225281
public static function installThemesAndFiles(Event $event)
    {
        $syncer = DirectorySyncer::fromEvent($event);

        $syncer->sync('files', 'files');
        $syncer->sync('%vendor%/bolt/themes', 'themes', true, ['base-2016', 'base-2018', 'skeleton']);
    }
1150455
public function runHelper(Event $event) {
		
		$options = $event->getOptions();
		
		$KSSHelper = new Helper($options);
		$KSSHelper->run();
		
	}
491009
public static function publish(Event $event)
    {
        $publisher = new static();
        $config = $publisher->getConfig($event);
        $assetPackage = $publisher->getAssetPackage($config);
        $composerPackage = $publisher->getComposerPackage($event);
        (new Processor(new Filesystem(), $event->getIO()))->publish(
            $event->getComposer()->getInstallationManager()->getInstallPath($composerPackage),
            $publisher->getPublishingMap($assetPackage, $config),
            $config->isSymlink(),
            $config->isRelative()
        );
    }
818506
public static function installAssets(CommandEvent $event)
    {
        $options = self::getOptions($event);
        $consoleDir = self::getConsoleDir($event, 'install Generator assets');
        if (null === $consoleDir) {
            return;
        }
        $webDir = $options['symfony-web-dir'];
        $symlink = '';

        if (!self::hasDirectory($event, 'symfony-web-dir', $webDir, 'install Generator assets')) {
            return;
        }
        static::executeCommand($event, $consoleDir, 'admin:assets-install');
    }
712797
public static function installJSDependencies($event) {
        echo "Installing JS Library dependencies for the AltamiraBundle\n";
        $dir = getcwd();

        ScriptHandler::gitSubmodulesUpdate();
        ScriptHandler::cleanPublicJSDir();


        // discovered that assetic can minify all the code - all not necessary anymore.
        /*
        echo "Compiling jqplot\n";
        chdir(static::getLibsDir().DIRECTORY_SEPARATOR."jqplot");
        exec('ant clean min', $output, $status);
        if ($status) {
            die("Ant failed with $status (is ant installed?)\n");
        }
        chdir($dir);

        echo "Compiling flot\n";
        $flotLib=static::getLibsDir() .DIRECTORY_SEPARATOR."flot";
        if (($files = scandir($flotLib)) ===false ) {
            die("failed to traverse through flot directory");
        }
        foreach ($files as $file) {
            if (substr($file,-3) == ".js") {
                exec(static::getYUIBin(). " ".escapeshellarg($flotLib.DIRECTORY_SEPARATOR.$file)." -o "
                    .escapeshellarg(static::getLibsDir().DIRECTORY_SEPARATOR."flot".DIRECTORY_SEPARATOR.substr($file,0,-2)."min.js"));
            }
        }

        echo "Compiling flot bubbles\n";
        $flotBubblesLib=static::getLibsDir() .DIRECTORY_SEPARATOR."flot-bubbles";
        if (($files = scandir($flotBubblesLib)) ===false ) {
            die("failed to traverse through flot bubbles directory");
        }

        foreach ($files as $file) {
            if (substr($file,-3) == ".js") {
                // minification did not work out, so commented min code.
                // exec(static::getYUIBin(). " ".escapeshellarg($flotBubblesLib.DIRECTORY_SEPARATOR.$file) ." -o "
                //    .escapeshellarg(static::getLibsDir().DIRECTORY_SEPARATOR."flot-bubbles".DIRECTORY_SEPARATOR.substr($file,0,-2)."min.js"));

                // straight copy to min.js for compatibility with min setting in altamira
                copy($flotBubblesLib.DIRECTORY_SEPARATOR.$file,static::getLibsDir().DIRECTORY_SEPARATOR."flot-bubbles".DIRECTORY_SEPARATOR.substr($file,0,-2)."min.js");
            }
        }*/

        echo "Installing jqplot\n";
        mkdir(static::getJSDir().DIRECTORY_SEPARATOR."jqplot",0777,true);
        $source = static::getLibsDir().DIRECTORY_SEPARATOR."jqplot".DIRECTORY_SEPARATOR."src";
        $dest= static::getJSDir().DIRECTORY_SEPARATOR."jqplot";
        recursiveAssetsOnlyCopy($source,$dest);



        echo "Installing flot\n";
        mkdir(static::getJSDir().DIRECTORY_SEPARATOR."flot",0777,true);
        recursiveAssetsOnlyCopy(static::getLibsDir().DIRECTORY_SEPARATOR."flot",static::getJSDir().DIRECTORY_SEPARATOR."flot");


        echo "Installing flot-bubbles\n";
        mkdir(static::getJSDir().DIRECTORY_SEPARATOR."flot-bubbles",0777,true);
        recursiveAssetsOnlyCopy(static::getLibsDir().DIRECTORY_SEPARATOR."flot-bubbles",static::getJSDir().DIRECTORY_SEPARATOR."flot-bubbles");
    }
796287
public static function installIgc2Kmz(Event $event)
    {
        $io = $event->getIO();
        $composer = $event->getComposer();
        $config = $composer->getConfig();

        $vendorDir = $config->get('vendor-dir');
        $binDir    = $config->get('bin-dir');
        $targetDir = $vendorDir . '/twpayne/igc2kmz';
        $binSource = $binDir . '/igc2kmz';
        $binTarget = $targetDir . '/bin/igc2kmz.py';

        require_once $config->get('vendor-dir') . '/autoload.php';

        $fs = new Filesystem();
        if ($fs->exists($binTarget) && $fs->exists($binSource)) {
            $io->write('  - Installing <info>igc2kmz</info> (<comment>master</comment>)');
            $io->write(sprintf('    Loading from cache', $targetDir));

            return;
        }

        $downloadManager = $composer->getDownloadManager();

        try {
            $package = self::createComposerInMemoryPackage($targetDir);
            $downloadManager->download($package, $targetDir);

            $fs->appendToFile(
                $binSource,
                "#!/bin/bash\n$(dirname \"\${BASH_SOURCE[0]}\")/../twpayne/igc2kmz/bin/igc2kmz.py \"$@\""
            );

            $process = new Process('chmod +x igc2kmz');
            $process->setWorkingDirectory($binDir);
            $process->run(function ($type, $buffer) use ($io) {
                if (!$io->isVerbose()) {
                    return;
                }
                echo $buffer;
            });

            $io->write('');
        } catch (\Exception $e) {
            $io->writeError($e->getMessage());
        }
    }
138387
public function onPostInstallCmd(Event $event) {

    $fs = new Filesystem();

    $working_dir = getcwd();
    $fabalicious_dir = dirname(__DIR__);

    $relative_dir = $fs->findShortestPath($working_dir, $fabalicious_dir);
    try {
      $fs->unlink('fabfile.py');
    }
    catch (\Exception $e) {
    }

    system(sprintf('ln -s %s/fabfile.py fabfile.py', $relative_dir));

    $this->io->write('Created symlink for fabalicious.');
  }
1220577
public static function notifyProjectUpdate(Event $event)
    {
        self::getContainer()->addJob(new UpdatedProjectNotify($event->getComposer()->getPackage()));
    }
35031
public static function installBundle( Event $event )
	{
		$event->getIO()->write( 'Installing the Aimeos shop bundle' );

		$options = self::getOptions( $event );
		$securedir = 'var';

		if( isset( $options['symfony-app-dir'] ) && is_dir( $options['symfony-app-dir'] ) ) {
			$securedir = $options['symfony-app-dir'];
		}

		if( isset( $options['symfony-var-dir'] ) && is_dir( $options['symfony-var-dir'] ) ) {
			$securedir = $options['symfony-var-dir'];
		}

		$webdir = ( isset( $options['symfony-web-dir'] ) ? $options['symfony-web-dir'] : 'public' );

		self::createDirectory( $securedir . '/secure' );
		self::createDirectory( $webdir . '/preview' );
		self::createDirectory( $webdir . '/files' );
	}
436376
public static function installDependencies( Event $event ) {
		if ( ! defined( 'WPEMERGE_CLI_DIR' ) ) {
			define( 'WPEMERGE_CLI_DIR', dirname( __DIR__ ) );
		}

		$input = new ArrayInput( [ 'install:dependencies' ] );
		$output = new ConsoleOutput();

		try {
			$application = static::create();
			$command = $application->find('install:dependencies');
			$command->run( $input, $output );
		} catch ( RuntimeException $e ) {
			$event->getIO()->write( '<error>' . $e->getMessage() . '</error>' );
		}
	}
1288317
public function listen(Event $event)
    {
        if (!empty($this->handledEvents[$event->getName()])) {
            return;
        }
        $this->handledEvents[$event->getName()] = true;
        // Plugin has been uninstalled
        if (!file_exists(__FILE__) || !file_exists(__DIR__ . '/PluginImplementation.php')) {
            return;
        }

        // Load the implementation only after updating Composer so that we get
        // the new version of the plugin when a new one was installed
        if (null === $this->pluginImplementation) {
            $this->pluginImplementation = new PluginImplementation($event);
        }

        switch ($event->getName()) {
            case ScriptEvents::PRE_AUTOLOAD_DUMP:
                $this->pluginImplementation->preAutoloadDump();
                break;
            case ScriptEvents::POST_AUTOLOAD_DUMP:
                $this->pluginImplementation->postAutoloadDump();
                break;
        }
    }