Gera a tag de link
@param array|string $fileName
@param bool $base_path
@return string
508447
public static function css($fileName, $base_path = true)
    {
        if (!is_array($fileName))
            $fileName = array($fileName);
        $data = null;
        foreach ($fileName as $file)
        {
            $url = "";
            $url .= ($base_path) ? self::getCSSLink() : '';
            $url .= $file;
            $data .= '<link rel="stylesheet" type="text/css" href="' . $url . '"/>' . PHP_EOL;
        }
        
        return $data;
    }
109193
protected function find_handler_path($filename) {
	$filename = strtolower($filename);
	
	if (preg_match('{[^a-z0-9/_-]}', $filename)) {
		return false;
	}
	
	$base_path = \alsvanzelf\fem\ROOT_DIR_APP.$this->handler_base_path.'/';
	$full_path = $base_path.$filename.'.php';
	if (file_exists($full_path) == false) {
		return false;
	}
	
	// sanity check to prevent escaping outside the base dir
	if (strpos($full_path, $base_path) !== 0) {
		return false;
	}
	
	return $full_path;
}
328299
public function findPath($classname, $basepath = null)
    {
        $path = false;

        if (strpos($classname, $this->_prefix) === 0) {
            $word = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $classname));
            $parts = explode('_', $word);

            if (array_shift($parts) == 'tmpl') {
                $name = array_shift($parts);

                $file = array_pop($parts);

                if (!empty($parts)) {
                    if ($parts[0] != 'view') {
                        foreach ($parts as $key => $value) {
                            $parts[$key] = AnInflector::pluralize($value);
                        }
                    } else {
                        $parts[0] = AnInflector::pluralize($parts[0]);
                    }

                    $path = implode('/', $parts).'/'.$file;
                } else {
                    $path = $file;
                }

                $path = $this->_basepath.'/templates/'.$name.'/'.$path.'.php';
            }
        }

        return $path;
    }
396074
function ( path, base )
{ let filename
  let start = path.substr ( 0, 2 )
  if ( path.charAt ( 0 )  === '/' )
  { // absolute path
    filename = path
  }
  else if ( start == './' || start == '..' || path == '.' )
  { filename = lpath.resolve ( base, path )
  }
  else
  { // funky node_modules path not supported
    throw new Error
    ( `Cannot watch path '${ path }'  ( not a relative or absolute path ) ` )
  }
  return filename
}
1087633
public function getFilesList( $basePath )
    {
        // The custom iterator filters out the file path in order to get a relative one
        return new eZDFSFileHandlerDFSBackendFilterIterator(
            new RecursiveIteratorIterator(
                new RecursiveDirectoryIterator(
                    $this->mountPointPath . '/' . $basePath,
                    FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS
                )
            ),
            $this->mountPointPath
        );
    }
17178
public function getBlockURL($filename = null)
    {
        $obj = $this->blockType;
        if ($obj->getPackageID() > 0) {
            if (is_dir(DIR_PACKAGES_CORE . '/' . $obj->getPackageHandle())) {
                $base = ASSETS_URL . '/' . DIRNAME_PACKAGES . '/' . $obj->getPackageHandle(
                    ) . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            } else {
                $base = DIR_REL . '/' . DIRNAME_PACKAGES . '/' . $obj->getPackageHandle(
                    ) . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            }
        } else {
            if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $filename)) {
                $base = REL_DIR_APPLICATION . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            } else {
                $base = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
            }
        }

        return $base;
    }
1367034
public function baseUrl($path) {

        $url = '';

        if (\strpos($path, ':')===false) {

            /*
            if ($this->registry['base_port'] != '80') {
                $url .= $this->registry['site_url'];
            }
            */

            $url .= $this->registry['base_url'].'/'.\ltrim($path, '/');

        } else {
            $url = $this->pathToUrl($path);
        }

        return $url;
    }
1134091
public function isFile($filename, $basePath = null)
    {
        if (!empty($basePath)) {
            $filename = $this->concatPaths([$basePath, $filename]);
        }

        if (file_exists($filename)) {
            return is_file($filename);
        }

        $fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
        if (!empty($fileExtension)) {
            return true;
        }

        return false;
    }
525323
function getUrl(baseUrl, filePath) {
  const filePathWithHash = getFilePathWithHash(filePath);

  const url = `${baseUrl}${filePathWithHash.replace(/\\/gi, '/')}`;

  return url;
}
1046772
function setBaseUrl(fileName) {
        //Use the file name's directory as the baseUrl if available.
        dir = fileName.replace(/\\/g, '/');
        if (dir.indexOf('/') !== -1) {
            dir = dir.split('/');
            dir.pop();
            dir = dir.join('/');
            exec("require({baseUrl: '" + dir + "'});");
        }
    }
667237
static function changeBasename( &$mimeInfo, $basename )
    {
        $mimeInfo['basename'] = $basename;
        $mimeInfo['filename'] = $basename . '.' . $mimeInfo['suffix'];
        if ( $mimeInfo['dirpath'] )
            $mimeInfo['url'] = $mimeInfo['dirpath'] . '/' . $mimeInfo['filename'];
        else
            $mimeInfo['url'] = $mimeInfo['filename'];
    }
925757
public function getImageUrl(Media $media, $basepath)
    {
        if ($media->getUrl() === parse_url($media->getUrl(), PHP_URL_PATH)) {
            return $basepath . $media->getUrl();
        }

        return $media->getUrl();
    }
354263
public static function js($fileName, $base_path = true)
    {
        if (!is_array($fileName))
            $fileName = array($fileName);
        $data = null;
        foreach ($fileName as $file)
        {
            $data .= '<script src="';
            $data .= ($base_path) ? self::getJSLink() : '';
            $data .= $file . '"></script>' . PHP_EOL;
        }
        return $data;
    }
493687
public function setBasePath($basePath = null) {
        if ($basePath === null) {
            $filename = (isset($this->SERVER['SCRIPT_FILENAME']))
                      ? basename($this->SERVER['SCRIPT_FILENAME'])
                      : '';

            $baseUrl = $this->getBaseUrl();
            if (empty($baseUrl)) {
                $this->_basePath = '';
                return $this;
            }

            if (basename($baseUrl) === $filename) {
                $basePath = dirname($baseUrl);
            } else {
                $basePath = $baseUrl;
            }
        }

        if (substr(PHP_OS, 0, 3) === 'WIN') {
            $basePath = str_replace('\\', '/', $basePath);
        }

        $this->_basePath = rtrim($basePath, '/');
        return $this;
    }
491385
public function getUrl(string $filename): GetUrlCommand
    {
        /** @var GetUrlCommand $command */
        $command = $this->builder->build(GetUrlCommand::class);
        $command->byFilename($filename);

        return $command;
    }
730788
public function fileUrl($attribute, $file = null)
    {
        $path = $this->templatePath($attribute, $file);
        return Yii::getAlias($this->fileOption($attribute, 'baseUrl')) . $path;
    }
504737
public function path($filename)
    {
        if (preg_match('~^' . $this->base_directory . '~', $filename)) {
            return $filename;
        }

        return rtrim($this->base_directory, '/') . '/' . ltrim($filename, '/');
    }