Get filename with or not extension.

@return string
971425
public function fileName($filename, $withExt = true)
    {
        return $withExt ? pathinfo($filename, PATHINFO_BASENAME) : pathinfo($filename, PATHINFO_FILENAME);
    }
1209700
protected function getFileName()
    {
        $fileName = parent::getFileName();

        if ($this->maxCount !== false) {
            $fileName = strtr($fileName, [$this->countPlaceHolder => $this->currentFileCount]);
        }

        return $fileName;
    }
1367097
public function getFileName() {

		if(null === $this -> filename && null !== $this -> viewmodel) {
			$this -> filename = md5($this -> viewmodel -> getFile());
		}

		return $this -> filename;
	}
510733
public function generateFilename()
    {
        $filename = $this->label().' '.date('Y-m-d H-i-s');
        $extension = $this->generateExtension();

        if ($extension) {
            return $filename.'.'.$extension;
        } else {
            return $filename;
        }
    }
1199836
function getFilename(){
		if($content_disposition = $this->getHeaderValue("Content-Disposition")){
			if(preg_match('/filename="(.*?)"/',$content_disposition,$matches)){
				return $matches[1];
			}
		}
		if(preg_match("/([^\\/?]+)(\\?.*|)$/",$this->_Uri,$matches)){
			return $matches[1];
		}
	}
744656
public function getPathExtension()
    {
        $segments = $this->getPathSegments();
        $filename = array_pop($segments);
        $extension = strrchr($filename, '.');

        if ($extension === false) {
            return '';
        }

        return substr($extension, 1);
    }
1310918
protected function getFileName($name) {
		
		// defaults
		$fileName = "";
		$dirSep   = DIRECTORY_SEPARATOR;
		
		// test to see what kind of path was supplied
		$posDash  = strpos($name,"-");
		$posSlash = strpos($name,$dirSep);
		
		if (($posSlash === false) && ($posDash !== false)) {
			$fileName = $this->baseDir.$dirSep.$this->patternUtil->getPatternFileName($name);
		} else {
			$fileName = $this->baseDir.$dirSep.$name;
		}
		
		if (substr($fileName, 0 - strlen($this->extension)) !== $this->extension) {
			$fileName .= $this->extension;
		}
		
		return $fileName;
		
	}
1163051
public function getBasename() : string
    {
        $basename = $this->getName();

        if(!empty($this->getExtension())) {
            $basename .= ".".$this->getExtension();
        }

        return $basename;
    }
656056
public function getName() {
		if ($this->_name === null) {
			$name = get_class($this);
			$pos = strrpos($name, '\\');
			if ($pos !== false) {
				$name = substr($name, $pos + 1);
			}
			if (preg_match('/^Twig([A-Za-z]+)Extension$/', $name, $matches)) {
				$name = $matches[1];
			}
			$this->_name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name));
		}
		return $this->_name;
	}
478873
static function filenameWithoutExtension($filename) {
		$filename=self::filename($filename);
		if (preg_match('~(.*)\.(\w{1,10})$~',$filename,$parts)) {
			return $parts[1];
		}
		return $filename;
	}
70998
public function getExtendedName()
    {
        $type = $this->getType();

        if ($type) {
            $extendedName = $type->getName();
        } else {
            $extendedName = '';
        }

        $catTitle = $this->getCategoryTitle();
        if ($catTitle !== null) {
            $extendedName .= '-' . $this->getCategoryTitle();
        }

        $extendedName .= '-' . $this->getName();

        return $extendedName;
    }
861774
protected function getFilename()
    {
        $filenameParts = [];
        $filenameParts[] = date('Y-m-d_H-i-s');

        if ($this->getTitle() != '') {
            $title = $this->getTitle();
            $title = str_replace(' ', '_', $title);

            $filenameParts[] = preg_replace('/[^a-z0-9_-]+/i', '', $title);
        }

        return implode('_', $filenameParts);
    }
434364
private function getFileName()
    {
        $name = $this->getArgumentNameOnly();

        switch ($this->option('type')) {
            case 'view':

                break;
            case 'model':
                $name = $this->getModelName();
                break;
            case 'controller':
                $name = $this->getControllerName($name);
                break;
            case 'seed':
                $name = $this->getSeedName($name);
                break;
        }

        // overide the name
        if ($this->option('name')) {
            return $this->option('name') . $this->settings['file_type'];
        }

        return $this->settings['prefix'] . $name . $this->settings['postfix'] . $this->settings['file_type'];
    }
154565
public function get_extension(){
    parent::get_extension();
		if ( !$this->ext2 && $this->file ){
			if ( function_exists('exif_imagetype') ){
				if ( $r = exif_imagetype($this->file) ){
          if ( !array_key_exists($r, bbn\file\image::$allowed_extensions) ){
            $this->ext = false;
          }
				}
				else{
          $this->ext = false;
        }
			}
			if ( $this->ext ){
				$this->ext2 = $this->ext;
				if ( $this->ext2 === 'jpg' ){
          $this->ext2 = 'jpeg';
        }
			}
		}
		return $this->ext;
	}
589689
public function getFilename()
    {
        if (isset($this->viewVars['_filename'])) {
            return $this->viewVars['_filename'] . '.xlsx';
        }

        return Inflector::slug(str_replace('.xlsx', '', $this->request->url)) . '.xlsx';
    }
867142
public function getFileName($strict = false)
  {
    if (!$this->hasFileName()) {
      if ($strict) {
        return false;
      }

      $arr = $this->getArguments();

      return current(array_slice($arr, -1));
    }

    return $this->file_name;
  }
219128
public function getFilename($extension = '.php')
    {
        // If template is named,
        // return joined template names.
        if ($this->isNamed()) {
            return join('-', $this->file) . $extension;
        }

        // Use first template name, if template
        // file is an array, but is not named.
        if (is_array($this->file) && isset($this->file[0])) {
            return "{$this->file[0]}{$extension}";
        }

        return apply_filters('tonik/gin/template/filename', "{$this->file}{$extension}");
    }