registerExtension

@param ExtensionInterface $extension

@return void
557922
public function removeExtension(ExtensionInterface $extension)
    {
        foreach ($extension->functions() as $func) {
            unset($this->functions[$func->getName()]);
        }
    }
524548
public function extend($name, ExtensionInterface $extension)
    {
        $this->getExtensions()->put($name, $extension);

        $extension->set($this);

        return $extension;
    }
886051
private function registerTwigExtensions ()
    {
        $this['twig'] = $this->share($this->extend('twig',
            function (Twig_Environment $twig, Application $app)
            {
                // add custom extension
                $twig->addExtension(new TwigExtension($app));

                // add global gluggi variable
                $twig->addGlobal("gluggi", [
                    "config" => $this["gluggi.config"]
                ]);

                return $twig;
            }
        ));
    }
1026315
public function addInterface($interface, $extends = [])
    {
        $interfaceId = $this->registerInterface($interface);
        if (!empty($extends)) {
            $interfaceIds = [];
            foreach ($extends as $name) {
                $interfaceIds[] = $this->registerInterface($name);
            }
            $this->interfaceExtends[$interfaceId] = $interfaceIds;
        }
    }
1350706
public function register()
    {
        $this->app->bind(LoaderInterface::class, ArrayLoader::class);

        $this->registerExtensionConfig();
        $this->registerExtensionFinder();
        $this->registerExtensionManager();
        $this->registerExtensionDispatcher();
        $this->registerExtensionBootstrap();
        $this->registerComposerHandler();
        $this->registerComponentsRepository();
    }
1147838
public function register_extensions() {
		$extensions = func_get_args();

		foreach ( $extensions as $extension ) {
			if ( $extension instanceof Twig_ExtensionInterface ) {
				$this->add_extension( $extension );
			} else if ( is_string( $extension ) && class_exists( $extension ) ) {
				$this->add_extension( new $extension );
			} else {
				foreach ( (array) $extension as $ext ) {
					$this->register_extensions( $ext );
				}
			}
		}
	}
905040
function registerExtension(ext) {
  var old = oldHandlers[ext] || oldHandlers[".js"] || require.extensions[".js"];

  var loader = normalLoader;
  if (process.env.running_under_istanbul) loader = istanbulLoader;

  require.extensions[ext] = function (m, filename) {
    if (shouldIgnore(filename)) {
      old(m, filename);
    } else {
      loader(m, filename, old);
    }
  };
}
363434
public function registerExtensionProviders(ExtensionContract $extension)
    {
        $filePath = $extension->getPath() . '/providers.php';

        if ($this->files->exists($filePath)) {
            $providers = (array) $this->files->getRequire($filePath);

            $this->provides($providers);
        }
    }
46952
function register($engine, $extension)
    {
        if (!class_exists($engine)) {
            throw new \InvalidArgumentException("Class $engine is not defined");
        }

        if (!class_implements($engine, "\\MetaTemplate\\Template\\TemplateInterface")) {
            throw new \InvalidArgumentException(
                "An engine must implement \\MetaTemplate\\Template\\TemplateInterface."
            );
        }

        $extensions = (array) $extension;

        foreach ($extensions as $extension) {
            $extension = Template::normalizeExtension($extension);
            $this->engines[$extension] = $engine;
        }

        return $this;
    }
936320
public function addExtension(ExtensionInterface $extension)
    {
        if (array_key_exists($name = $extension->getName(), $this->extensions)) {
            throw new \RuntimeException(sprintf('UserExtension "%s" is already registered.', $name));
        }

        $this->extensions[$name] = $extension;
    }
950837
public function addExtension(string $name, ?Struct $extension): void
    {
        $this->extensions[$name] = $extension;
    }
338894
private function isAllowedExtension($extension = null)
    {
        if(!$extension && $this->extension) {
            $extension = $this->extension;
        }

        if(!$extension) {
            throw new \Exception("No extension given");
        }

        if(array_intersect([strtolower($extension),strtoupper($extension)], self::allowedExtensions())) {
            return true;
        }
        return false;
    }
299160
public function addTypeExtension($type, $extension, $priority = 0)
    {
        if ($extension instanceof ExtensionInterface) {
            $this->extensionRegistry->addExtension($extension);
            $this->typeExtension[$type][$priority][get_class($extension)] = true;
        } elseif (is_string($extension)) {
            $this->typeExtension[$type][$priority][$extension] = true;
        }

        return $this;
    }
402180
public function add_extension( Twig_ExtensionInterface $extension ) {
		$env  = $this->instance();
		$exts = $env->getExtensions();

		if ( isset( $exts[$extension->getName()] ) ) {
			return;
		}

		try {
			$env->addExtension( $extension );
		} catch ( LogicException $e ) {
			return;
		}
	}
897581
private void registerExtensions() {
    Iterator<Cache2kExtensionProvider> it =
      ServiceLoader.load(Cache2kExtensionProvider.class, CacheManager.class.getClassLoader()).iterator();
    while (it.hasNext()) {
      try {
        it.next().registerCache2kExtension();
      } catch (ServiceConfigurationError ex) {
        Log.getLog(CacheManager.class.getName()).debug("Error loading cache2k extension", ex);
      }
    }
  }
834035
public function registerExtension(common_ext_Extension $extension)
    {
        $entry = array(
        	'installed' => $extension->getManifest()->getVersion(),
            'enabled' => false 
        );
        $extensions = $this->getExtensionById('generis')->getConfig(self::EXTENSIONS_CONFIG_KEY);
        $extensions[$extension->getId()] = $entry;
        return $this->getExtensionById('generis')->setConfig(self::EXTENSIONS_CONFIG_KEY, $extensions);
    }
889023
public function addExtension($extension)
    {
        if (($index = array_search($extension, $this->extensions)) !== false) {
            unset($this->extensions[$index]);
        }

        array_unshift($this->extensions, $extension);
    }