Dump all info about extension
@param   string $extensionName Extension name
@return  JBDump
178270
public static function extInfo($extensionName)
    {

        $result = self::_getExtension($extensionName);
        if ($result) {
            $extensionName = $result['name'];
        }

        return self::i()->dump($result, '! extension (' . $extensionName . ') !');
    }
211806
public function replaceExtension($filename, $extension)
    {
        $parts = $this->splitFilename($filename);
        $newFilename = $parts[0] . $parts[1];
        if (is_string($extension) && ($extension !== '')) {
            $newFilename .= '.' . $extension;
        }

        return $newFilename;
    }
1004629
public static function hasExtension($baseName, array $extensions)
    {
        // Lowercase names
        $baseName = strtolower($baseName);

        $extensions = array_map(function($key){
            return strtolower($key);
        }, $extensions);

        return in_array(self::getExtension($baseName), $extensions);
    }
792621
public function offsetGet($extensionName)
    {
        if (isset($this->data[$extensionName])) {
            return $this->data[$extensionName];
        }

        $extension = $this->extensionManager->getExtension($this->structureType, $extensionName);

        // TODO: should not pass namespace here.
        //       and indeed this call should be removed and the extension should be
        //       passed the document.
        $extension->setLanguageCode($this->locale, $this->prefix, $this->internalPrefix);

        // passing the webspace and locale would also be unnecessary if we passed the
        // document
        $data = $extension->load($this->node, $this->webspaceName, $this->locale);

        $this->data[$extensionName] = $data;

        return $data;
    }
921225
public function replaceExtension($extension)
    {
        $atoms = $this->nameAtoms();
        if (array('', '') === $atoms) {
            if (null === $extension) {
                return $this;
            }

            return $this->replaceName(
                static::EXTENSION_SEPARATOR . $extension
            );
        }

        $numAtoms = count($atoms);

        if ($numAtoms > 1) {
            if (null === $extension) {
                $replacement = array();
            } else {
                $replacement = array($extension);
            }

            array_splice($atoms, -1, $numAtoms, $replacement);
        } elseif (null !== $extension) {
            $atoms[] = $extension;
        }

        return $this->replaceName(implode(self::EXTENSION_SEPARATOR, $atoms));
    }
667692
public function dump($data, $rootName = 'root')
    {
        $dom = $this->writeToDom($data, $rootName);

        return $dom->saveXML();
    }
856149
public static function includeFileExtension($fileName, $extension)
    {
        $fileExtension = self::getFileExtension($fileName, true);

        /*
         * File has given extension?
         * Nothing to do
         */
        if ($fileExtension === strtolower($extension)) {
            return $fileName;
        }

        return sprintf('%s.%s', $fileName, $extension);
    }
703035
public static function getMediaTypeFromFilename(string $filename): string
    {
        $pathinfo = pathinfo(strtolower($filename));
        if (!isset($pathinfo['extension'])) {
            return 'application/octet-stream';
        }
        return self::$extensionToMediaType[$pathinfo['extension']] ?? 'application/octet-stream';
    }
60898
public function addExtension($className)
    {
        $object = is_object($className) ? $className : null;
        $className = is_object($className) ? get_class($object) : $className;

        $this->checkExtension($className);

        self::$extensions[$className] = $object;
        return $this;
    }
230360
public static function findExtensionsFiles($fileName = 'config/main.php') : array
    {
        $output     = [];
        $fileNames  = !is_array($fileName) ? [$fileName] : $fileName;
        if (empty(static::$extensions)) {
            static::$extensions = (array) require Yii::getAlias('@root/vendor/yiisoft/extensions.php');
        }
        foreach (static::$extensions as $ext => $data) {
            if (is_array($data['alias'])) {
                foreach ($data['alias'] as $alias => $path) {
                    foreach ($fileNames as $fileName) {
                        $file = $path . '/' .$fileName;
                        if ((strpos($ext, 'setrun') !== false) && file_exists($file)) {
                            $output[] = $file;
                        }
                    }
                }
            }
        }
        return $output;
    }
638854
public function convertTo($filename)
    {
        $outputExtension = pathinfo($filename, PATHINFO_EXTENSION);
        $supportedExtensions = $this->getAllowedConverter($this->extension);

        if (!in_array($outputExtension, $supportedExtensions)) {
            throw new OfficeConverterException("Output extension({$outputExtension}) not supported for input file({$this->basename})");
        }

        $outdir = $this->tempPath;
        $shell = $this->exec($this->makeCommand($outdir, $outputExtension));
        if ($shell['return'] != 0) {
            throw new OfficeConverterException("Convertion Failure! Contact Server Admin.");
        }

        return $this->prepOutput($outdir, $filename, $outputExtension);
    }
1202746
public function getNameWithExtension()
    {
        return $this->extension === '' ? $this->name : sprintf('%s.%s', $this->name, $this->extension);
    }
465727
public function getExtension()
	{
		if (!isset($this->extension))
		{
			$bits = explode('.', $this->getName());
			if (count($bits) > 1)
			{
				$this->extension = end($bits);
			}
			else
			{
				$this->extension = '';
			}
		}

		return $this->extension;
	}
649596
public function setFileName($fileName)
	{
		$hasFilename = ($this->fileName !== null);
		
		if ($hasFilename) {
			$previousName = $this->fileName;
			$previousExtension = $this->getExtension();
		}
		
		parent::setFileName($fileName);
		
		if ($hasFilename) {
			
			$newExtension = $this->getExtension();

			if (strcasecmp($previousExtension, $newExtension) !== 0) {

				// restore name back to previous one. Because that's safer.
				parent::setFileName($previousName);

				throw new \RuntimeException('Extension change is not allowed');
			}
		}
	}
840412
final public function saveImage($filename)
	{
		$extension = pathinfo($filename, PATHINFO_EXTENSION);

		if (! is_string($extension)) {
			$extension = image_type_to_extension($this->_image_type);
			$filename .= ".{$extension}";
		}

		switch(strtolower($extension))
		{
			case 'jpeg':
			case 'jpg':
				return $this->imageJPEG($filename);
				break;

			case 'png':
				return $this->imagePNG($filename);
				break;

			case 'gif':
				return $this->imageGIF($filename);

			default:
				trigger_error('Invalid extension or not an image', E_USER_WARNING);
				return false;
		}
	}
885037
public function getExtension()
    {
        $basename = $this->getBasename();
        if (false !== $pos = strrpos($basename, '.')) {
            $ext = substr($basename, $pos + 1);
        } else {
            $ext = '';
        }
        return $ext;
    }
1114454
public function getUniqueFilename($filename)
    {
        $info = pathinfo($filename);
        $name = $info['filename'];
        $ext = isset($info['extension']) ? '.'.$info['extension'] : '';
        for ($i = 1; file_exists($info['dirname'].'/'.$name.$ext); ++$i) {
            $name = $info['filename'].'['.$i.']';
        }

        return $info['dirname'].'/'.$name.$ext;
    }