Returns requested base name (domain+directory)

@param string $baseName

@return string
488676
public function baseName($baseName = null)
    {
        if ($baseName !== null) {
            $this->baseName = rtrim($baseName, '/') . '/';
        }

        return $this->baseName;
    }
441948
protected function fileBasename( $name )
    {
        $pos = strrpos( $name, '.' );
        if ( $pos !== false )
        {
            $name = substr( $name, 0, $pos );
        }
        return $name;
    }
1183673
function getBasename(relativePath) {
    const mayBeSuffix = [".ts", ".tsx", ".d.ts"];
    let mayBePath = relativePath;
    mayBeSuffix.map(suffix => {
        const tmpPath = path_1.default.basename(relativePath, suffix);
        if (tmpPath.length < mayBePath.length) {
            mayBePath = tmpPath;
        }
    });
    // Return whichever path is shorter. If they're the same length then nothing was stripped.
    return mayBePath;
}
670790
public function getBasePath(): string
	{
		if($this->basePath === null)
		{
			$path = $this->server->get('SCRIPT_NAME');

			$this->basePath = rtrim(str_replace(basename($path), '', $path), '/');
		}

		return $this->basePath;
	}
1177627
public function basePath()
    {
        if ($this->dirname && $this->basename) {
            return ($this->dirname .'/'. $this->basename);
        }

        return null;
    }
1004117
public function getBasePath() : ?string 
    {
        if ( ! $this->hasBasePath()) {
            $this->setBasePath($this->getDefaultBasePath());
        }
        return $this->basePath;
    }
1242763
protected function _getBasePath($plugin = false)
    {
        if ($plugin !== false) {
            return $this->_getPluginPath($plugin) . 'webroot' . DS;
        }

        return WWW_ROOT;
    }
175751
protected function getWsdlFileName($serviceName)
	{
		if(null === $this->cacheInstance)
		{
			$this->createCacheInstance();
		}
		$cacheAlias = 'WSDL' . $serviceName;
		$fileName = $this->cacheInstance->getFileName($cacheAlias);
		if(!is_file($fileName))
		{
			$this->getWsdlNoCache($serviceName);
		}
		return $fileName;
	}
455026
public function imagePath(string $basename): string
    {
        $path = 'image/' . PathBuilder::sharedInstance()
            ->generate($this->user(), $this->type(), $basename);

        return Storage::disk($this->disk)
            ->path($path);
    }
79572
public function getLinkbase( $linkbaseName )
	{
		return isset( $this->linkbases[ basename( $linkbaseName ) ] )
			? $this->linkbases[ basename( $linkbaseName ) ]
			: null;
	}
107790
public function slug(string $basename): string
    {
        if (($slug = mb_strstr($basename, '/', true))) {
            return $slug; // Got what we need here.
        } elseif (($slug = mb_strstr($basename, '.php', true))) {
            return $slug; // Got what we need here.
        }
        return ''; // Failed on `[slug]/plugin.php` & `[slug].php`.
    }
1086120
private function getBasePath()
	{
		$pathInfo = new Http\RequestFactory;
		$basePath = rtrim($pathInfo->createHttpRequest()->url->basePath, '/');
		return $basePath;
	}
285842
function get_addon_basename( $id_or_slug ) {
            $addon_id = self::get_module_id( $id_or_slug );

            if ( $this->is_addon_activated( $addon_id ) ) {
                return self::instance( $addon_id )->get_plugin_basename();
            }

            $addon            = $this->get_addon( $addon_id );
            $premium_basename = "{$addon->premium_slug}/{$addon->slug}.php";

            if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) {
                return $premium_basename;
            }

            $all_plugins = $this->get_all_plugins();

            foreach ( $all_plugins as $basename => $data ) {
                if ( $addon->slug === $data['slug'] ||
                     $addon->premium_slug === $data['slug']
                ) {
                    return $basename;
                }
            }

            $free_basename = "{$addon->slug}/{$addon->slug}.php";

            return $free_basename;
        }
57347
public function getBasehref() {
		$script_name = dirname($_SERVER['SCRIPT_NAME']);
		$script_name = str_replace('\\', '/', $script_name); // for Windows paths
		$path = '/'. trim($script_name, '/') .'/';

		// If it is the root the return value of dirname is slash
		if ($path == '//') $path = '/';
		$scheme = isset($_SERVER['HTTPS']) || isset($_SERVER['HTTP_X_SSL_ACTIVE']) || (isset($_SERVER['SSL_PROTOCOL']) && !empty($_SERVER['SSL_PROTOCOL'])) ? 'https://' : 'http://';

		$host = php_sapi_name() === 'cli' ? gethostname() : $_SERVER['HTTP_HOST']; // Exception for cli
		$base_href = $scheme . $host . $path;

		return $base_href;
	}
1285343
protected function getAllBasenames()
    {
        $path = $this->getPath();

        try {
            $collection = collect($this->files->directories($path));

            $basenames = $collection->map(function ($item, $key) {
                return basename($item);
            });

            return $basenames;
        } catch (\InvalidArgumentException $e) {
            return collect([]);
        }
    }
253860
public function getBasename($suffix = null)
    {
        if (is_null($suffix)) {
            return parent::getBasename();
        }

        return str_replace('.' . $this->getExtension(), '.' . trim($suffix, '.'), parent::getFilename());
    }
231034
def basename(path, ext=""):
    """"""
    import os.path
    if ext is False:
        return os.path.basename(path).replace(extname(path), "")
    else:
        return os.path.basename(path).replace(ext, "")