Returns locale independent base name of the given path.

@param string $name The new file name

@return string containing
488232
protected function getName($name)
    {
        $name = parent::getName($name);

        // This fixes any URL encoded filename and sanitize it
        $name = strtolower(urldecode($name));

        // Replace spaces with a dash
        $name = preg_replace('!\s+!', '-', $name);

        // Remove odd characters
        return preg_replace('/[^A-Za-z0-9\-_\.]/', '', $name);
    }
848372
protected function getPath($name)
    {
        $name = $this->getFileName();

        $withName = boolval($this->option('name'));

        $path = $this->settings['path'];
        if ($this->settingsDirectoryNamespace() === true) {
            $path .= $this->getArgumentPath($withName);
        }

        $path .= $name;

        return $path;
    }
628396
protected function _getLayoutFileName($name = null)
    {
        if ($name === null) {
            $name = $this->layout;
        }
        $subDir = null;

        if ($this->layoutPath) {
            $subDir = $this->layoutPath . DIRECTORY_SEPARATOR;
        }
        list($plugin, $name) = $this->pluginSplit($name);

        $layoutPaths = $this->_getSubPaths('Layout' . DIRECTORY_SEPARATOR . $subDir);

        foreach ($this->_paths($plugin) as $path) {
            foreach ($layoutPaths as $layoutPath) {
                $currentPath = $path . $layoutPath;
                if (file_exists($currentPath . $name . $this->_ext)) {
                    return $this->_checkFilePath($currentPath . $name . $this->_ext, $currentPath);
                }
            }
        }
        throw new MissingLayoutException([
            'file' => $layoutPaths[0] . $name . $this->_ext
        ]);
    }
235657
protected function getPathFromExtensionName($name)
    {
        $basePath   = $this->app->make('antares.extension')->getExtensionPathByName($name);
        $paths      = ["{$basePath}/resources/public", "{$basePath}/public"];

        foreach ($paths as $path) {
            if ($this->app->make('files')->isDirectory($path)) {
                return $path;
            }
        }

        return;
    }
939882
protected function parseName($name)
    {
        $this->checkNamespace();

        $rootNamespace = $this->getPackageNamespace();

        if (Str::startsWith($name, $rootNamespace)) {
            return $name;
        }

        if (Str::contains($name, '/')) {
            $name = str_replace('/', '\\', $name);
        }

        return $this->parseName($this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name);
    }
767750
public static function dumpName(string $name): string
    {
        if (self::isLikeName($name)) {
            return $name;
        }
        return self::dumpInline($name);
    }
43545
protected function getFileName($name)
    {
        $name = (string) $name;

        try {
            $template = $this->parser->parse($name);
            $file     = $this->locator->locate($template);
        } catch (\Exception $e) {
            throw new \InvalidArgumentException(sprintf('Unable to find template "%s".', $name));
        }

        return $file;
    }
797333
protected function getCreateMigrationName($name)
    {
        $filename = sprintf('%s_create_%s_table.php', date('Y_m_d_His'), strtolower($name));

        return Helpers::postFixWith($filename, '.php');
    }
236582
protected function getOriginalName($name)
    {
        foreach (array_keys($this->headers) as $key) {
            if (strtolower($key) === strtolower($name)) {
                return $key;
            }
        }

        return false;
    }
968290
public static function basename($path) {
        $pos = strrpos($path, '/');
        if ($pos === false) {
            return $path;
        }
        return substr($path, $pos + 1);
    }
433270
private function getTypeName($name)
    {
        if (!$name) {
            return null;
        }

        if (is_string($name)) {
            return $name;
        }

        $prefix = '';
        if ($name instanceof NullableType) {
            $name   = $name->type;
            $prefix = '?';
        }

        return $prefix . $this->getFullClassName($name);
    }
780125
private function basename($path)
    {
        $separators = '/';
        if (DIRECTORY_SEPARATOR != '/') {
            // For Windows OS add special separator.
            $separators .= DIRECTORY_SEPARATOR;
        }

        // Remove right-most slashes when $path points to directory.
        $path = rtrim($path, $separators);

        // Returns the trailing part of the $path starting after one of the directory separators.
        $filename = preg_match('@[^'.preg_quote($separators, '@').']+$@', $path, $matches) ? $matches[0] : '';

        return $filename;
    }
1129243
public static function extractShortNameFromFullyQualifiedName($name)
    {
        if (($pos = strrpos($name, '\\')) !== false) {
            return substr($name, $pos + 1);
        } else {
            return $name;
        }
    }
501699
private function getPath($name)
    {
        if (!isset($this->paths[$name])) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Unknown path segment name "%s", known paths are "%s"',
                    $name,
                    implode('", "', array_keys($this->paths))
                )
            );
        }

        $name = $this->paths[$name];

        return $name;
    }
280711
protected static function getFilePath($name)
  {
    $path = str_replace("_", DIRECTORY_SEPARATOR, $name);
    $path = str_replace(__CLASS__, dirname(__FILE__), $path);

    return $path;
  }
710353
public static function getFileBaseNameWithoutExt($path)
    {
        $baseName = pathinfo($path,PATHINFO_BASENAME);
        $extName= self::getFileExtName($path);
        $pos=strrpos($baseName, $extName);
        if($pos>0){
            $baseName=substr($baseName, 0,$pos-1);
        }
        return $baseName;
    }
745000
protected function _prependPrefixToFilename($name)
    {
        $ds = DIRECTORY_SEPARATOR;
        $parts = explode($ds, $name);
        $filename = end($parts);

        if ($name === $filename
            || $filename[0] === $this->optionalDependencyPrefix) {
            return $this->optionalDependencyPrefix . $name;
        }

        return str_replace(
            $ds . $filename,
            $ds . $this->optionalDependencyPrefix . $filename,
            $name
        );
    }