Automatic assets loading from an Assets package declare in a `composer.json`

@return void
194325
public function load()
    {
        if (empty($this->_statements)) {
            parent::load();
        }

        /* @var $template_engine \TemplateEngine\TemplateEngine */
        $template_engine = TemplateEngine::getInstance();

        foreach ($this->getOrganizedStatements() as $type=>$statements) {
            foreach ($statements as $statement) {
                if ('css'===$type) {
                    $template_object = $template_engine->getTemplateObject('CssFile');
                    $css = $statement->getData();
                    if (isset($css['minified']) && true===$css['minified']) {
                        $template_object->addMinified($css['src'], $css['media']);
                    } else {
                        $template_object->add($css['src'], $css['media']);
                    }
                } elseif ('jsfiles_header'===$type) {
                    $template_object = $template_engine->getTemplateObject('JavascriptFile', 'jsfiles_header');
                    $js = $statement->getData();
                    if (
                        (isset($js['minified']) && true===$js['minified']) ||
                        (isset($js['packed']) && true===$js['packed'])
                    ) {
                        $template_object->addMinified($js['src']);
                    } else {
                        $template_object->add($js['src']);
                    }
                } elseif (in_array($type, array('js', 'jsfiles_footer'))) {
                    $template_object = $template_engine->getTemplateObject('JavascriptFile', 'jsfiles_footer');
                    $js = $statement->getData();
                    if (
                        (isset($js['minified']) && true===$js['minified']) ||
                        (isset($js['packed']) && true===$js['packed'])
                    ) {
                        $template_object->addMinified($js['src']);
                    } else {
                        $template_object->add($js['src']);
                    }
                }
            }
        }
    }
445260
protected function registerAssets()
    {
        $view = $this->getView();
        SelectizeAsset::register($view);
        $js = '$("#' . $this->getInputId() . '").selectize(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);
    }
920812
protected function copyAssets()
    {
        $packagePath = $this->packagePath();

        if ($this->useWindows()) {
            $source = $packagePath."/public/assets";
        } else {
            $source = $packagePath."/public/assets/";
        }
        $destination = $this->normalizePath(public_path('assets'));
        if (! File::exists($source)) {
            File::makeDirectory($source);
        }
        if (! File::exists($destination)) {
            File::makeDirectory($destination);
        }
        $copyAssetsCommand = $this->copyCommand().' '.$this->copyOptions().' "'.$source.'" "'.$destination.'" > nul';

        shell_exec($copyAssetsCommand);
    }
117539
public function onPreAutoloadDump()
    {
        if (!class_exists(IncludeFile::class)) {
            // Plugin package was removed
            return;
        }
        $includeFilePath = $this->composer->getConfig()->get('vendor-dir') . self::INCLUDE_FILE;
        $includeFile = new IncludeFile($this->config, $this->createLoader(), $includeFilePath);
        if ($includeFile->dump()) {
            $rootPackage = $this->composer->getPackage();
            $autoloadDefinition = $rootPackage->getAutoload();
            $autoloadDefinition['files'][] = $includeFilePath;
            $rootPackage->setAutoload($autoloadDefinition);
            $this->io->writeError('<info>Registered helhum/dotenv-connector</info>');
        } else {
            $this->io->writeError('<error>Could not dump helhum/dotenv-connector autoload include file</error>');
        }
    }
289780
private function loadPackageAssets($packageVariant, Package $package)
	{
		$variants = $package->getVariants();
		$requiredVariant = $variants[$packageVariant];

		if (isset($requiredVariant['scripts'])) {
			$scripts = [];
			foreach ($requiredVariant['scripts'] as $script) {
				$scripts[] = new Asset($package, $script);
			}
			$this->assetsLoader->addScripts($scripts);
		}

		if (isset($requiredVariant['styles'])) {
			$styles = [];
			foreach ($requiredVariant['styles'] as $style) {
				$styles[] = new Asset($package, $style);
			}
			$this->assetsLoader->addStyles($styles);
		}
	}
186140
private function autoload()
    {
        $app = $this;
        $finder = new Finder();

        foreach ($finder->in($app['singular.directory.app'])->files()->name('*.php') as $file) {
            include_once $file->getRealpath();
        }
    }
226265
public function registerAssets()
    {
        $view = $this->getView();
        $id = $this->options['id'];
        $settings = $this->settings;
        $assets = $this->assets;
        if ($this->preset) {
            $preset = $this->getPreset($this->preset);
            if (isset($preset['settings'])) {
                $settings = ArrayHelper::merge($preset['settings'], $settings);
            }
            if (isset($preset['assets'])) {
                $assets = ArrayHelper::merge($preset['assets'], $assets);
            }
        }
        $settings = Json::encode($settings);
        $js = "CodeMirror.fromTextArea(document.getElementById('$id'), $settings);";
        $view->registerJs($js);
        CodemirrorAsset::register($this->view, $assets);
    }
138284
public function registerAssets()
    {
        $view = $this->getView();
        $bundle = SweetalertAsset::register($view);
        $bundle->theme = $this->theme;
    }
499245
public function registerAssets()
    {
        foreach (array_merge($this->assets, $this->getTheme()->assets) as $asset) {
            /** @var AssetBundle $asset */
            $asset::register($this->getView());
        }
    }
942991
private function initialize()
    {
        foreach ($this->globs as $glob) {
            $glob = VarUtils::resolve($glob, $this->getVars(), $this->getValues());

            if (false !== $paths = glob($glob)) {
                foreach ($paths as $path) {
                    if (is_file($path)) {
                        $asset = new FileAsset($path, array(), $this->getSourceRoot(), null, $this->getVars());
                        $asset->setValues($this->getValues());
                        $this->add($asset);
                    }
                }
            }
        }

        $this->initialized = true;
    }
501755
public function registerClassLoader() : void
    {
        if ($this->root === null) {
            return;
        }

        $path = sprintf('%s/%s/autoload.php', $this->root, $this->getVendorDirectory());

        if (!is_file($path)) {
            return;
        }

        require $path;
    }
1135781
private function updateAutomatically()
    {
        $source = $this->event->getComposer()->getConfig()->getConfigSource();
        $file = new JsonFile($source->getName(), null, $this->io);
        $contents = $file->read();

        $this->scripts = $contents['scripts'] = $this->modifyScripts($contents['scripts']);

        $file->write($contents);

        $this->io->writeError([
            '<info>',
            'Bolt has a new separate composer script handler to help with updates!',
            "We've automatically added this to your composer.json!",
            '</info>',
        ]);
    }
1197474
protected function registerAssets()
    {
        if ($this->hasTitle()) {
            $view = $this->getView();
            AlertAsset::register($view);
            $js = "sweetAlert({$this->getOptions()}, {$this->callback});";
            $view->registerJs($js, $view::POS_END);
        }
    }
143543
protected function loadAssetsCache()
    {
        $cachedFiles = $this->cachedFilesObjectBackend->loadObject();
        if (!is_array($cachedFiles)) {
            $cachedFiles = array();
        }
        
        $this->cachedFiles = $cachedFiles;
    }
1312061
protected function register_assets() {
		$icon_picker = Icon_Picker::instance();

		if ( defined( 'ICON_PICKER_SCRIPT_DEBUG' ) && ICON_PICKER_SCRIPT_DEBUG ) {
			$assets_url = '//localhost:8080';
			$suffix     = '';
		} else {
			$assets_url = $icon_picker->url;
			$suffix     = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
		}

		wp_register_script(
			'icon-picker',
			"{$assets_url}/js/icon-picker{$suffix}.js",
			array( 'media-views' ),
			Icon_Picker::VERSION,
			true
		);
		$this->add_script( 'icon-picker' );

		wp_register_style(
			'icon-picker',
			"{$icon_picker->url}/css/icon-picker{$suffix}.css",
			false,
			Icon_Picker::VERSION
		);
		$this->add_style( 'icon-picker' );
	}
1233411
protected function setupAssets()
    {
        $this->mergeConfigFrom($config = __DIR__ . '/config/datatables.php', 'datatables');

        if ($this->app->runningInConsole()) {
            $this->publishes([$config => config_path('datatables.php')], 'datatables');
        }
    }
1283859
public function loadComposer() {
    if ($ownVendor = $this->tryPath('vendor/', BootLoader::RELATIVE | BootLoader::VALIDATE)) {
      $this->autoLoader = require $ownVendor.'autoload.php';
    } else {
      // when bootstrapping is inside a dependency of another project
      $this->autoLoader = require $this->getPath('../../', BootLoader::RELATIVE | BootLoader::VALIDATE).'autoload.php';
    }
  }