Simply rewrites extensions file from scratch.
@param Event $event
5839
public function onPostAutoloadDump(Event $event)
    {
        $this->io->writeError('<info>Generating extensions files</info>');
        foreach ($this->getPackages() as $package) {
            if ($package instanceof \Composer\Package\CompletePackageInterface) {
                $this->processPackage($package);
            }
        }
        $this->processPackage($this->composer->getPackage());

        foreach ($this->data as $name => $data) {
            $this->saveFile($this->buildOutputPath($name), $data);
        }
    }
810556
public static function setPermissions(Event $event)
    {
        $options = array_merge(
            array(
                self::PARAM_WRITABLE => array(),
                self::PARAM_EXECUTABLE => array(),
            ),
            $event->getComposer()->getPackage()->getExtra()
        );

        foreach ((array)$options[self::PARAM_WRITABLE] as $path) {
            echo "Setting writable: $path ...";
            if (is_dir($path)) {
                chmod($path, 0777);
                echo "done\n";
            } else {
                echo "The directory was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path;
                return;
            }
        }

        foreach ((array)$options[self::PARAM_EXECUTABLE] as $path) {
            echo "Setting executable: $path ... ";
            if (is_file($path)) {
                chmod($path, 0755);
                echo "done\n";
            } else {
                echo "\n\tThe file was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path . "\n";
                return;
            }
        }
    }
881
protected function raise($event)
    {
        $qualified = get_class($event);
        $name = str_replace('\\', '.', $qualified);

        $this->events->fire($name, [$event]);
    }
187678
public static function generate(Event $event)
    {
        $args = $event->getArguments();
        if (empty($args)) {
            echo "Usage:\n\n"
                . "    composer yasql-generate -- YASQL_FILE [INDENTATION]\n\n"
                . "By default, INDENTATION is 2\n";
            die(1);
        }

        echo Controller::generate(
            file_get_contents($args[0]),
            null,
            $args[1] ?? 2
        );
    }
412138
public function sendEvent(Event $event)
    {
        try {
            $this->eventFactory->addDefaultTagsToEntity($event);
            $this->sendEventThroughSenders($event);
        } catch (\Exception $exception) {
            $this->logException($exception);
        }
    }
46768
private function applyRegistrationCallbacks(Event $event)
    {
        foreach ($this->registrationCallbacks as $callback) {
            $event = $callback->onEventRegistration($event);
        }

        return $event;
    }
342922
public static function migrateUp(Event $event)
    {
        $dir = self::getRootDir().'DoctrineMigrations';
        if (self::isHaveMigrations($dir)) {
            self::repackMigrations($dir);
            self::executeCommand('doctrine:migrations:migrate --no-interaction', $event->getIO());
        }
    }
137547
private function preProcess(Event $event)
	{
		foreach ($this->dispatcher->getListeners($event) as $listener)
		{
			if ($listener instanceof TraceableListener)
			{
				continue;
			}

			$priority = $this->dispatcher->getListenerPriority($listener, $event);

			//$this->dispatcher->removeListener($listener, $event);

			$info = $this->getListenerInfo($listener, $event->getName());
			$name = isset($info['class']) ? $info['class'] : $info['type'];

			$this->dispatcher->getListeners()[$event->getName()]->remove($listener);
			$this->dispatcher->getListeners()[$event->getName()]->add(new TraceableListener($listener, $name, $this->stopwatch), $priority);

			//$this->dispatcher->addListener(new TraceableListener($listener, $name, $this->stopwatch), array($event->getName() => $priority));
		}
	}
303804
public static function postInstall(Event $event)
    {
        // initialize the installation directory
        $override = false;
        $installDir = getcwd();

        // check the arguments for an installation directory
        foreach ($event->getArguments() as $arg) {
            // extract arguments
            list ($key, ) = explode('=', $arg);
            // query we want to override files
            if ($key === SetupKeys::ARG_OVERRIDE) {
                $override = true;
            }
            // query for a custom installation directory
            if ($key === SetupKeys::ARG_INSTALL_DIR) {
                $installDir = str_replace("$key=", '', $arg);
            }
        }

        Setup::prepareContext($installDir, $event);

        // process and move the configuration files their target directory
        Setup::processTemplate('etc/appserver/appserver.xml', $override);
        Setup::processTemplate('etc/appserver/appserver-runner.xml', $override);

        // write a message to the console
        $event->getIo()->write(
            sprintf(
                '%s<info>Successfully invoked appserver.io Composer post-install-cmd script ...</info>',
                Setup::$logo
            )
        );
    }
637271
public static function setPermissions(Event $event)
	{
		if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
			$event->getIO()->write('<info>No permissions setup is required on Windows.</info>');
			return;
		}
		$event->getIO()->write('Setting up permissions.');
		/*		try {
					self::setPermissionsSetfacl($event);
					return;
				} catch (\Exception $setfaclException) {
					$event->getIO()->write(sprintf('<error>%s</error>', $setfaclException->getMessage()));
					$event->getIO()->write('<info>Trying chmod...</info>');
				}*/
		try {
			self::setPermissionsChmod($event);
			return;
		} catch (\Exception $chmodException) {
			$event->getIO()->write(sprintf('<error>%s</error>', $chmodException->getMessage()));
		}
	}
194073
public static function onFlushContent(Event $event)
    {
        $content = $event->getTarget();
        $application = $event->getApplication();

        $token = $application->getSecurityContext()->getToken();
        if (!($token instanceof BBUserToken)) {
            return;
        }

        $em = $application->getEntityManager();
        $uow = $em->getUnitOfWork();

        if ($uow->isScheduledForInsert($content) && AbstractClassContent::STATE_NEW === $content->getState()) {
            if (null === $draft = $content->getDraft()) {
                $draft = $em->getRepository('BackBee\ClassContent\Revision')->checkout($content, $token);
            }

            $content->setDraft($draft);
            $em->persist($draft);
            $uow->computeChangeSet($em->getClassMetadata('BackBee\ClassContent\Revision'), $draft);
        } elseif ($uow->isScheduledForDelete($content)) {
            $revisions = $em->getRepository('BackBee\ClassContent\Revision')->getRevisions($content);
            foreach ($revisions as $revision) {
                $revision->setContent(null);
                $revision->setState(Revision::STATE_DELETED);
                $uow->computeChangeSet($em->getClassMetadata('BackBee\ClassContent\Revision'), $revision);
            }
        }
    }
1139937
public static function postPackageInstall(Event $event)
    {
        $config = $event->getComposer()->getConfig();
        $binDir = $config->get("bin-dir");
        self::initScript($binDir);

    }
357452
function rewrite_extension(source, ext) {
  var source_ext = path.extname(source);
  return (source_ext === ext) ? source : (source + ext);
}
661375
public function copyProjectExtraFiles(Event $event): void
    {
        $extras = $event->getComposer()->getPackage()->getExtra();
        if (array_key_exists('copy-files', $extras)) {
            $this->installer->getIo()->write(
                sprintf('  - Copied additional file(s)'),
                true
            );
            $this->copyExtras($extras['copy-files']);
        }
    }
602046
public function attach($event)
    {
        $this->attachRows($event);
        $this->attachSeo($event);
        $this->attachAnonsModule($event);
    }
6833
public function setTemplateExtension($extension)
    {
        $extension = (string) $extension;
        $extension = trim($extension);
        if ('.' == $extension[0]) {
            $extension = substr($extension, 1);
        }

        $this->extension = $extension;
    }
1150455
public function runHelper(Event $event) {
		
		$options = $event->getOptions();
		
		$KSSHelper = new Helper($options);
		$KSSHelper->run();
		
	}