Get or create if needed the extension

@return extensions object
334151
public Extensions getOrCreateExtension() {

		// Create table
		geoPackage.createContentsIdTable();

		Extensions extension = getOrCreate(EXTENSION_NAME, null, null,
				EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE);

		return extension;
	}
537744
public List<Extensions> getOrCreate() {

		// Create tables
		geoPackage.createGriddedCoverageTable();
		geoPackage.createGriddedTileTable();

		List<Extensions> extensionList = new ArrayList<>();

		Extensions coverage = getOrCreate(EXTENSION_NAME,
				GriddedCoverage.TABLE_NAME, null, EXTENSION_DEFINITION,
				ExtensionScopeType.READ_WRITE);
		Extensions tile = getOrCreate(EXTENSION_NAME, GriddedTile.TABLE_NAME,
				null, EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE);
		Extensions table = getOrCreate(EXTENSION_NAME,
				tileMatrixSet.getTableName(), TileTable.COLUMN_TILE_DATA,
				EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE);

		extensionList.add(coverage);
		extensionList.add(tile);
		extensionList.add(table);

		return extensionList;
	}
63541
public static function &GetDefinitions()
    {
        if(!self::ValidExtension())
        {
            CommandLine\Error::Show(t("Invalid extension directory, definitions could not be loaded."));
        }

        if(!is_object(self::$symbols))
        {
            self::$symbols = new Definitions\Symbols;
            
            $importer = new Definitions\Importer(
                self::$symbols, 
                "definitions",
                Definitions\Type::JSON
            );
            
            $importer->Start();
        }

        return self::$symbols;
    }
1202746
public function getNameWithExtension()
    {
        return $this->extension === '' ? $this->name : sprintf('%s.%s', $this->name, $this->extension);
    }
27032
protected function getConfig()
    {
        if ($this->config !== null) {
            return $this->config;
        }

        $this->config = $this->getDefaultConfig();

        $app = $this->getContainer();

        $file = $app['filesystem']->getFile(strtolower("extensions_config://{$this->getName()}.{$this->getVendor()}.yml"));

        if (!$file->exists()) {
            try {
                $this->copyDistFile($file);
            } catch (RuntimeException $e) {
                return $this->config;
            }
        }

        $this->addConfig($file);

        $localFile = $file->getParent()->getFile($file->getFilename('.yml') . '_local.yml');
        if ($localFile->exists()) {
            $this->addConfig($localFile);
        }

        return $this->config;
    }
393146
protected static function _getExtension($extensionName)
    {
        if (!extension_loaded($extensionName)) {
            return false;
        }

        $ext    = new ReflectionExtension($extensionName);
        $result = array();

        $result['name']    = $ext->name;
        $result['version'] = $ext->getVersion();
        if ($constants = $ext->getConstants()) {
            $result['constants'] = $constants;
        }
        if ($classesName = $ext->getClassNames()) {
            $result['classesName'] = $classesName;
        }
        if ($functions = $ext->getFunctions()) {
            $result['functions'] = $functions;
        }
        if ($dependencies = $ext->getDependencies()) {
            $result['dependencies'] = $dependencies;
        }
        if ($INIEntries = $ext->getINIEntries()) {
            $result['INIEntries'] = $INIEntries;
        }

        $functions = $ext->getFunctions();
        if (is_array($functions) && count($functions) > 0) {
            $result['functions'] = array();
            foreach ($functions as $function) {
                $funcName                       = $function->getName();
                $result['functions'][$funcName] = self::_getFunction($funcName);
            }
        }

        return $result;
    }
1322511
public function getExtension()
    {
        $pathInfo = pathinfo($this->getName());
        $extension = ExtensionGuesser::getInstance()->guess($this->getMimeType());
        if ($extension) {
            return $extension;
        } elseif (isset($pathInfo['extension'])) {
            return $pathInfo['extension'];
        }

        return null;
    }
1109981
public function ext()
    {
        if (!$this->info) {
            $this->info();
        }
        if (isset($this->info['extension'])) {
            return $this->info['extension'];
        }

        return false;
    }
1186727
public function getExtensionInstance($extension)
    {
        $instances = $this->getExtensionInstances();
        if (array_key_exists($extension, $instances)) {
            return $instances[$extension];
        }
        // in case Injector has been used to replace an extension
        foreach ($instances as $instance) {
            if (is_a($instance, $extension)) {
                return $instance;
            }
        }
        return null;
    }
426421
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new ExtensionRange();
			case 1:
				return new ExtensionRange(func_get_arg(0));
			case 2:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1));
			case 3:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new ExtensionRange(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
89207
public function getExtension()
    {
        if (is_null($this->extension) === true) {
            $filename = parent::getFilename();
            $str = new StringWrapper($filename);
            $this->extension = $str->getFirstEndMatch($this->predefinedExtensions);
            $this->hasPredefinedExt = true;

            if ($this->extension === '') {
                $this->hasPredefinedExt = false;
                $this->extension = parent::getExtension();
            }
        }

        return $this->extension;
    }
872214
public function addExtension($extension = null)
    {
        if ($extension == null) {
            return $this->twigEnvironment->addExtension($this->twigDebug());
        }

        return $this->twigEnvironment->addExtension($extension);
    }
1224836
public function getExtension()
    {
        if (version_compare(PHP_VERSION, '5.3.6') >= 0) {
            return parent::getExtension();
        } else {
            return ltrim(pathinfo($this->getAbsolutePath(), PATHINFO_EXTENSION), '.');
        }
    }
1183264
public function getExtension(string $name)
    {
        return isset($this->extensions[$name]) ? $this->extensions[$name] : null;
    }
351772
public Extensions getOrCreate() {

		// Create the attributes table
		if (!geoPackage.isTable(TABLE_NAME)) {

			AttributesColumn propertyColumn = AttributesColumn.createColumn(1,
					COLUMN_PROPERTY, GeoPackageDataType.TEXT, true, null);
			AttributesColumn valueColumn = AttributesColumn.createColumn(2,
					COLUMN_VALUE, GeoPackageDataType.TEXT, false, null);

			List<AttributesColumn> additionalColumns = new ArrayList<>();
			additionalColumns.add(propertyColumn);
			additionalColumns.add(valueColumn);

			List<UserUniqueConstraint<AttributesColumn>> uniqueConstraints = new ArrayList<>();
			uniqueConstraints.add(new UserUniqueConstraint<AttributesColumn>(
					propertyColumn, valueColumn));

			geoPackage.createAttributesTableWithId(TABLE_NAME,
					additionalColumns, uniqueConstraints);
		}

		Extensions extension = getOrCreate(EXTENSION_NAME, TABLE_NAME, null,
				EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE);

		return extension;
	}
1331403
public function withExtensions(Ext\Extension ...$exts): Extensions
    {
        $obj = clone $this;
        foreach ($exts as $ext) {
            $obj->_extensions[$ext->oid()] = $ext;
        }
        return $obj;
    }
951523
public function getExecOptionsResolver()
    {
        if (null === $this->execOptionsResolver) {
            if (null !== $this->parent) {
                $this->execOptionsResolver = clone $this->parent->getExecOptionsResolver();
            } else {
                $this->execOptionsResolver = new OptionsResolver();
            }

            $this->innerType->setExecOptions($this->execOptionsResolver);

            foreach ($this->typeExtensions as $extension) {
                $extension->setExecOptions($this->execOptionsResolver);
            }
        }

        return $this->execOptionsResolver;
    }