Usage: {asset_find_file file='' type='' folder=''}
Required: file and type

@return string
198072
public function asset_find_file($params) {
        if (!isset($params['file'])) {
            throw new \UnexpectedValueException("The file parameter is required.");
        }
        if (!isset($params['type'])) {
            throw new \UnexpectedValueException("The type parameter is required.");
        }
        $folder = isset($params['folder']) ? $params['folder'] : '';
        return Asset::find_file($params['file'], $params['file'], $folder);
    }
1307134
protected function getAssetsUrl()
    {
        if (!isset($this->_assetsUrl)) {
            $assetPath = dirname(__DIR__) . '/assets';
            $this->_assetsUrl = Yii::app()->assetManager->publish($assetPath, false, -1, $this->forceCopyAssets);
        }
        return $this->_assetsUrl;
    }
457345
protected static function useStatic()
	{
		if(isset(self::$_useStatic)) {
			return self::$_useStatic;
		}

		self::$_useStatic = AssetsSettings::assetsUseStatic();

		return self::$_useStatic;
	}
214657
public function getDumpFilePath () : string
    {
        $dir = dirname($this->filePath);
        $fileName = \basename($this->filePath, ".{$this->fileType}");

        $dir = "." === $dir
            ? ""
            : "{$dir}/";

        $hash = !empty($this->fileNameHash)
            ? ".{$this->fileNameHash}"
            : "";

        return "{$dir}{$fileName}{$hash}.{$this->fileType}";
    }
651368
public function getTypes()
    {
        //Gets the folders list
        list($folders) = (new Folder(UPLOADED))->read(true, true);

        //Each folder is a file type supported by KCFinder
        foreach ($folders as $type) {
            $types[$type] = '';
        }

        //Adds the "images" type by default
        $types['images'] = '*img';

        return $types;
    }
576013
function (asset) {
    var bundle = this.bundle;
    var requires = bundle.getRequiredFiles(asset.assetFilePath);
    if (requires.length > 0) {
      return requires.map(function (file) {
        return bundle.getAsset(file).logicalPath;
      });
    } else {
      return [asset.logicalPath];
    }
  }
1374065
public function getAssetFileList()
    {
        $propertyList = $this->_getEntityList('Files');
        $result = [];

        foreach ($propertyList as $properties) {
            $result[] = AssetFile::createFromOptions($properties);
        }

        return $result;
    }
1107275
protected function getAssetPath(Asset $asset):string
    {
        // Get the file name from the provider data
        $data = $asset->getProviderData();
        $path = $this->getRootPath() . "/" . $this->getCategoryDirectory() . "/" . $data["file"];
        return $path;
    }
928953
public function file() {
        $this->check_role = 'file';
        if (!$this->value) {
            $result = false;
        } else if ($this->value instanceof File) {
            $result = is_file($this->value->path_tmp);
        } else {
            $result = is_file($this->value);
        }
        $this->checkResult($result);
        return $this;
    }
1011475
public function getFullDb()
    {
        $filesystem = new Filesystem();
        $config = $this->_composer->getConfig();
        $assets_db = $this->_autoloader->getRegistry();
        $vendor_dir = $this->_autoloader->getAssetsInstaller()->getVendorDir();
        $app_base_path = $this->_autoloader->getAssetsInstaller()->getAppBasePath();
        $assets_dir = str_replace($app_base_path . '/', '', $this->_autoloader->getAssetsInstaller()->getAssetsDir());
        $assets_vendor_dir = str_replace($app_base_path . '/' . $assets_dir . '/', '', $this->_autoloader->getAssetsInstaller()->getAssetsVendorDir());
        $document_root = $this->_autoloader->getAssetsInstaller()->getDocumentRoot();
        $extra = $this->_package->getExtra();

        $root_data = $this->_autoloader->getAssetsInstaller()->parseComposerExtra($this->_package, $app_base_path, '');
        if (!empty($root_data)) {
            $root_data['relative_path'] = '../';
            $assets_db[$this->_package->getPrettyName()] = $root_data;
        }

        $vendor_path = strtr(realpath($vendor_dir), '\\', '/');
        $rel_vendor_path = $filesystem->findShortestPath(getcwd(), $vendor_path, true);

        $local_repo = $this->_composer->getRepositoryManager()->getLocalRepository();
        $package_map = $this->buildPackageMap($this->_composer->getInstallationManager(), $this->_package, $local_repo->getPackages());

        foreach ($package_map as $i=>$package) {
            if ($i===0) {
                continue;
            }
            $package_object = $package[0];
            $package_install_path = $package[1];
            if (empty($package_install_path)) {
                $package_install_path = $app_base_path;
            }
            $package_name = $package_object->getPrettyName();
            $data = $this->_autoloader->getAssetsInstaller()->parseComposerExtra(
                $package_object,
                $this->_autoloader->getAssetsInstaller()->getAssetsInstallPath($package_object),
                str_replace($app_base_path . '/', '', $vendor_path) . '/' . $package_object->getPrettyName()
            );
            if (!empty($data)) {
                $assets_db[$package_name] = $data;
            }
        }

        $full_db = array(
            'assets-dir' => $assets_dir,
            'assets-vendor-dir' => $assets_vendor_dir,
            'document-root' => $document_root,
            'packages' => $assets_db
        );
        return $full_db;
    }
213122
public function getCacheDir()
    {
        $fileSystem = new Filesystem();
        $path = 'var/cache/assets/'.$this->name.'/';
        
        if (!$fileSystem->exists($path)) {
            $fileSystem->mkdir($path);
        }
        
        return $path;
    }
131027
public function findFallbackAsset($asset, $Folder = null)
    {
        $folderEmpty = empty($Folder);
        $folderAllowFallback = ! empty($Folder) && $Folder->getFallback();

        if ($folderEmpty || $folderAllowFallback) {
            $fallbackPath = $this->engine->getDirectory();

            $fallbackPath = $this->removeViewFromPath($fallbackPath);
            if (file_exists($fallbackPath . DS . $asset)) {
                $this->createSymlink($fallbackPath);

                return '/' . $this->assetDir . '/' . $this->asset['asset'];
            }
        }

        return false;
    }
798500
public function findAssets () : array
    {
        $assets = [];

        foreach ($this->namespaces as $namespace => $dir)
        {
            if (!\is_dir($dir))
            {
                continue;
            }

            $finder = new Finder();

            $finder
                ->files()
                ->followLinks()
                ->in($dir);

            foreach ($finder as $foundFile)
            {
                $assets[] = new Asset($namespace, $foundFile->getRelativePathname());
            }
        }

        return $assets;
    }
1011251
protected function getPhpFilesetFinder() {
    $finder = new Finder();
    $finder
      ->files()
      ->name("*.inc")
      ->name("*.install")
      ->name("*.module")
      ->name("*.php")
      ->name("*.profile")
      ->name("*.test")
      ->name("*.theme")
      // Behat php files are ignored because method names and comments do not
      // conform to Drupal coding standards by default.
      ->notPath('behat')
      ->notPath('node_modules')
      ->notPath('vendor');
    return $finder;
  }
39727
public static function getAssets(){

    // first call? include styles and javascript
    if(static::$didAssets)
      return '';

    ob_start();

    if(ref::config('stylePath') !== false){
      ?>
      <style scoped>
        <?php readfile(str_replace('{:dir}', __DIR__, ref::config('stylePath'))); ?>
      </style>
      <?php
    }

    if(ref::config('scriptPath') !== false){
      ?>
      <script>
        <?php readfile(str_replace('{:dir}', __DIR__, ref::config('scriptPath'))); ?>
      </script>
      <?php
    }

    // normalize space and remove comments
    $output = preg_replace('/\s+/', ' ', trim(ob_get_clean()));
    $output = preg_replace('!/\*.*?\*/!s', '', $output);
    $output = preg_replace('/\n\s*\n/', "\n", $output);

    static::$didAssets = true;
    return $output;
  }
229775
public function currentLfmType()
    {
        $lfm_type = 'file';

        $request_type = lcfirst(str_singular($this->input('type') ?: ''));
        $available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);

        if (in_array($request_type, $available_types)) {
            $lfm_type = $request_type;
        }

        return $lfm_type;
    }
1347498
public function getMime()
    {
        if (!$this->mime)
        {
            $type = FileType::getFromFile($this->getFullPath());
            $this->mime = $type->getMimeType();
        }
        return $this->mime;
    }