@param string $name

@return AssetBundle|false an asset bundle from the view or false if asset bundle not found
199883
private function getAssetBundleFromView($name)
    {
        $view = $this->getView();

        if (!isset($view->assetBundles[$name])) {
            return false;
        }

        $bundle = $view->assetBundles[$name];

        if (!($bundle instanceof AssetBundle)) {
            return false;
        }

        if ($this->ignoredBundles->match($name)
            || $this->ignoredPositions->match($bundle->jsOptions)
        ) {
            return false;
        }

        return $bundle;
    }
947967
public function resolve($name)
    {
    	if (preg_match('#\.\.[\\\/]#', $name)) {
            throw new Exception\DomainException(
                'Requested asset may not include parent directory traversal ("../", "..\\" notation)'
            );
        }
        
    	// Check if we have paths
        if (!count($this->paths)) {
            //$this->lastLookupFailure = static::FAILURE_NO_PATHS;
            return null;
        }
        
        // TODO: Check cache!!!
        
        $files = array();
        foreach ($this->paths as $path) {
            $file = new SplFileInfo($path . $name);
            if ($file->isReadable()) {
                // Found! Return it.
                if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') {
                    // Do not try to expand phar paths (realpath + phars == fail)
                    $filePath = $path . $name;
                    if (!file_exists($filePath)) {
                        break;
                    }
                }
                
                $files[] = $filePath;
            }
        }

        $count = count($files);
        if ($count > 1) {
        	$canAppend = $this->canAppend($name);
        	if ($canAppend) {
        		$content = '';
        		foreach ($files as $file) {
        			$fileContent = file_get_contents($file);
        			if ($fileContents) {
        				$content .= $fileContent;
        			}
        		}
        		return $content;
        	} else {
        		// TODO: Create an exception
        		throw new \Exception("Too many assets found.");
        	}
        } elseif($count === 1) {
        	$content = file_get_contents($files[0]);
        	if ($content) {
        		return $content;
        	}
        }
        
        return null;
    }
793173
public function getAsset($asset)
    {
        if (!isset($this->assetCache[$asset])) {
            $this->assetCache[$asset] = $this->assetRepository->createAsset($asset);
        }
        return $this->assetCache[$asset];
    }
694409
public function getBundle($name)
    {
        $bundle = null;
        if ($this->getContainer()->has('bundle.'.$name)) {
            $bundle = $this->getContainer()->get('bundle.'.$name);
        }

        return $bundle;
    }
150693
protected function validateFileType($name)
    {
        $extension = strtolower(File::extension($name));

        if (!in_array($extension, $this->assetExtensions)) {
            return false;
        }

        return true;
    }
114203
public function extractBundleConfigurationFromKernel($name)
    {
        $kernelBundles = $this->getContainer()->get('kernel')->getBundles();
        $bundle = null;

        if (preg_match('/Bundle$/', $name)) {
            if (!isset($kernelBundles[$name])) {
                throw new \LogicException(sprintf('Bundle "%s" does not exists or is not activated.', $name));
            }

            $bundle = $kernelBundles[$name];
        } else {
            foreach ($kernelBundles as $kernelBundle) {
                $extension = $kernelBundle->getContainerExtension();

                if ($extension && $extension->getAlias() == $name) {
                    $bundle = $kernelBundle;
                    break;
                }
            }

            if (null === $bundle) {
                throw new \LogicException(sprintf('Bundle with alias "%s" does not exists or is not activated.', $name));
            }
        }

        $bundleContainer = $this->getContainer()->get('atoum.configuration.bundle.container');

        if ($bundleContainer->has($bundle->getName())) {
            return $bundleContainer->get($bundle->getName());
        } else {
            return new BundleConfiguration($bundle->getName(), $this->getDefaultDirectoriesForBundle($bundle));
        }
    }
752792
public function bundle($files, $name = 'app')
    {
        if (!$files) {
            return '';
        }

        $hash = substr(md5(implode('', $files)), 0, $this->_length);
        $extension = pathinfo($files[0], PATHINFO_EXTENSION);
        if ($pos = strpos($extension, '?')) {
            $extension = substr($extension, 0, $pos);
        }

        $bundle = ($name[0] !== '/' ? "/assets/bundle/$name" : $name) . ".$hash.$extension";

        if ($this->configure->debug || !is_file($target = $this->alias->get('@public') . "/$bundle")) {
            $r = '';
            foreach ($files as $file) {
                if ($file[0] !== '@') {
                    $file = '@public' . $file;
                }
                $source_file = $file;

                if ($pos = strpos($file, '?')) {
                    $file = substr($file, 0, $pos);
                }

                if (($content = file_get_contents($this->alias->resolve($file))) === false) {
                    throw new FileNotFoundException(['bundled `:file` file is not exists', 'file' => $file]);
                }

                if ($extension === 'css') {
                    $content = $this->_replaceCssUrl($file, $content);
                }

                $content = preg_replace('@/\*\# sourceMappingURL=[^*]+\s+\*/@', '', $content);

                $r .= PHP_EOL . PHP_EOL . "/* SOURCE_FILE `$source_file` */" . PHP_EOL . $content;
            }

            $this->filesystem->filePut("@public$bundle", $r);
        }

        return $this->alias->resolve("@asset$bundle");
    }
232613
public function hasBundle($name) {
        if (isset($this->_globalConfig['bundles'][$name])) {
            return true;
        } else {
            foreach ($this->_bundleConfig as $value) {
                if ($value['short_name'] == $name) {
                    return true;
                }
            }
            return false;
        }
    }
1097742
public function dropColumn($name, $bundle = null)
    {
        $attr = TableRegistry::get('Eav.EavAttributes')->find()
            ->where([
                'name' => $name,
                'table_alias' => $this->_table->table(),
                'bundle IS' => $bundle,
            ])
            ->limit(1)
            ->first();

        Cache::clear(false, 'eav_table_attrs');
        if ($attr) {
            return (bool)TableRegistry::get('Eav.EavAttributes')->delete($attr);
        }

        return false;
    }
33915
public function actionUninstall($name=false)
	{
		if ($name == false)
			return false;

		if ($name == 'default')
			throw new CHttpException(400, Yii::t('Api.theme', 'You cannot uninstall the default theme.'));

		if (!$this->actionIsInstalled($name))
			return false;

		$installedThemes 	= $this->actionInstalled();
		$theme 				= $installedThemes[$name]['path'];
		$iterator 			= new RecursiveIteratorIterator(
									new RecursiveDirectoryIterator($theme, FilesystemIterator::SKIP_DOTS),
									RecursiveIteratorIterator::CHILD_FIRST
							  );
		foreach ($iterator as $path)
			$path->isDir() ? rmdir($path->getPathname()) : unlink($path->getPathname());

		return rmdir($theme);
	}
1102486
protected function load($name)
    {
        if (!$this->initialized) {
            $this->initialize();
        }

        if (isset($this->cache[$name])) {
            return $this->cache[$name];
        }

        $cache = $this->cachePath ? sprintf('%s/%s.cache', $this->cachePath, sha1($name)) : false;

        if (!$cache) {

            $storage = new StringStorage($this->compile($this->loader->getSource($name), $name));

        } else {

            if (!is_file($cache) || !$this->isTemplateFresh($name, filemtime($cache))) {
                $this->writeCacheFile($cache, $this->compile($this->loader->getSource($name), $name));
            }

            $storage = new FileStorage($cache);
        }

        return $this->cache[$name] = $storage;
    }
282774
public function addToBundle($name, $deps)
    {
        if ($name == '') {
            throw new exception\InvalidArgumentException('The require.js bundle name must not be empty');
        }

        if (!is_array($deps) && !($deps instanceof \Traversable)) {
            $deps = [ $deps ];
        }

        if (!isset($this->bundles[$name])) {
            $this->bundles[$name] = [];
        }

        foreach ($deps as $item) {
            $item = (string)$item;

            if ($item != '') {
                $this->bundles[$name][] = $item;
            }
        }

        return $this;
    }
451996
public function GetAsset($AssetName) {
      if (!array_key_exists($AssetName, $this->Assets))
         return '';
      if (!is_array($this->Assets[$AssetName]))
         return $this->Assets[$AssetName];
      
      // Include the module sort
      $Modules = Gdn::Config('Modules', array());
      if ($this->ModuleSortContainer === FALSE)
         $ModuleSort = FALSE; // no sort wanted
      elseif (array_key_exists($this->ModuleSortContainer, $Modules) && array_key_exists($AssetName, $Modules[$this->ModuleSortContainer]))
         $ModuleSort = $Modules[$this->ModuleSortContainer][$AssetName]; // explicit sort
      elseif (array_key_exists($this->Application, $Modules) && array_key_exists($AssetName, $Modules[$this->Application]))
         $ModuleSort = $Modules[$this->Application][$AssetName]; // application default sort

      // Get all the assets for this AssetContainer
      $ThisAssets = $this->Assets[$AssetName];
      $Assets = array();
      
      if (isset($ModuleSort) && is_array($ModuleSort)) {
         // There is a specified sort so sort by it.
         foreach ($ModuleSort as $Name) {
            if (array_key_exists($Name, $ThisAssets)) {
               $Assets[] = $ThisAssets[$Name];
               unset($ThisAssets[$Name]);
            }
         }
      }
      
      // Pick up any leftover assets that werent explicitly sorted
      foreach ($ThisAssets as $Name => $Asset)
         $Assets[] = $Asset;
         
      if (count($Assets) == 0) {
         return '';
      } elseif (count($Assets) == 1) {
         return $Assets[0];
      } else {
         $Result = new Gdn_ModuleCollection();
         $Result->Items = $Assets;
         return $Result;
      }
   }
835815
public function findView($name)
	{
		if (substr($name, -5) !== '.twig')
		{
			$name .= '.twig';
		}

		if ( ! $file = parent::findView($name))
		{
			throw new Twig_Error_Loader('Could not locate: '.$name);
		}

		return $file;
	}
609020
private function checkAsset($name, array &$previously)
    {
        $formula = $this->am->hasFormula($name) ? serialize($this->am->getFormula($name)) : null;
        $asset = $this->am->get($name);

        $combinations = VarUtils::getCombinations(
            $asset->getVars(),
            $this->getContainer()->getParameter('assetic.variables')
        );

        $mtime = 0;
        foreach ($combinations as $combination) {
            $asset->setValues($combination);
            $mtime = max($mtime, $this->am->getLastModified($asset));
        }

        if (isset($previously[$name])) {
            $changed = $previously[$name]['mtime'] != $mtime || $previously[$name]['formula'] != $formula;
        } else {
            $changed = true;
        }

        $previously[$name] = array('mtime' => $mtime, 'formula' => $formula);

        return $changed;
    }
653868
public function getLoadedFile(string $name)
    {
        $properties                     = $this->getProperties();
        $loadedFiles                    = $properties['loadedFiles'];
        $names                          = array_column($loadedFiles, 'name');
        if (in_array($name, $names)) {
            $key = array_search($name, array_column($loadedFiles, 'name'));
            return $loadedFiles[$key];
        }
        return false;
    }
227125
public function getController(string $name = '')
    {
        if (empty($name)) {
            $name = $this->getComponentsName();
        }

        $controller = $this->MVCFactory($name, 'Controller');

        return $controller;
    }