function prependExtensions($extensions) { foreach ((array) $extensions as $ext) { $this->extensions->unshift(Path::normalizeExtension($ext)); } return $this; }
protected function getExtensions() { if (null === $this->extensions) { $basename = $this->getBasename(); # Avoid treating name of a dotfile as extension by # ignoring dots at the first offset in the string if (!$basename or false === ($pos = strpos($basename, '.', 1))) { return array(); } $extensions = explode('.', substr($basename, $pos + 1)); $this->extensions = array_map(function ($ext) { return Path::normalizeExtension($ext); }, $extensions); } return $this->extensions; }
protected function getExtension() { return Path::normalizeExtension(pathinfo($this->path, PATHINFO_EXTENSION)); }
/** * Returns the content type for the extension, .e.g. "application/javascript" * for ".js". * * @param string $extension * @return string */ function contentType($extension) { return @$this->contentTypes[FileUtils\Path::normalizeExtension($extension)]; }
static function normalizeExtension($extension) { return Path::normalizeExtension($extension); }