* @return array
*/
protected function getJsonManifest(string $jsonManifest): array
{
if (! file_exists($jsonManifest)) {
throw new ManifestNotFoundException("The manifest [{$jsonManifest}] cannot be found.");
}
return json_decode(file_get_contents($jsonManifest), true) ?? [];
}
$config = $this->pipeline($config);
$path = $config['path'];
$url = $config['url'];
$assets = isset($config['assets']) ? $this->getJsonManifest($config['assets']) : [];
$bundles = isset($config['bundles']) ? $this->getJsonManifest($config['bundles']) : [];
return new Manifest($path, $url, $assets, $bundles);
}
* @param array $config
* @return ManifestContract
*/
public function manifest(string $name, ?array $config = null): ManifestContract
{
$manifest = $this->manifests[$name] ?? $this->resolve($name, $config);
return $this->manifests[$name] = $manifest;
}
/**
$this->app->singleton('assets', function () {
return new Manager($this->app->make('config')->get('assets'));
});
$this->app->singleton('assets.manifest', function ($app) {
return $app['assets']->manifest($this->getDefaultManifest());
});
$this->app->alias('assets.manifest', \Roots\Acorn\Assets\Manifest::class);
}
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure) {
return $concrete($this, $this->getLastParameterOverride());
}
try {
$reflector = new ReflectionClass($concrete);
} catch (ReflectionException $e) {
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
// If we defined any extenders for this type, we'll need to spin through them
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::resolve($abstract, $parameters, $raiseEvents);
}
/**
* Load the deferred provider if the given type is a deferred service and the instance has not been loaded.
*
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*
*/
public function make($abstract, array $parameters = [])
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
{
if (is_null($abstract)) {
return Container::getInstance();
}
return Container::getInstance()->make($abstract, $parameters);
}
}
if (! function_exists('app_path')) {
/**
* @return Asset
*/
function asset(string $asset, ?string $manifest = null): Asset
{
if (! $manifest) {
return \app('assets.manifest')->asset($asset);
}
return \app('assets')->manifest($manifest)->asset($asset);
}
* Register the theme assets.
*
* @return void
*/
add_action('wp_enqueue_scripts', function () {
if (asset('scripts/vendor.js')->exists()) {
wp_enqueue_script('sage/vendor.js',asset('scripts/vendor.js')->uri(), ['jquery'], null, true);
$deps = ['sage/vendor.js'];
} else {
$deps = ['jquery'];
}
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
*
* @param array $args Parameters to pass to the callback functions.
*/
public function do_action( $args ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
$arg[0] = $arg[0][0];
}
$wp_filter[ $hook_name ]->do_action( $arg );
array_pop( $wp_current_filter );
}
/**
/**
* Fires when scripts and styles are enqueued.
*
* @since 2.8.0
*/
do_action( 'wp_enqueue_scripts' );
}
/**
* Prints the styles queue in the HTML head on admin pages.
*
// Avoid the array_slice() if possible.
if ( 0 == $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
*
* @param array $args Parameters to pass to the callback functions.
*/
public function do_action( $args ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
$arg[0] = $arg[0][0];
}
$wp_filter[ $hook_name ]->do_action( $arg );
array_pop( $wp_current_filter );
}
/**
/**
* Prints scripts or data in the head tag on the front end.
*
* @since 1.5.0
*/
do_action( 'wp_head' );
}
/**
* Fire the wp_footer action.
*
<html <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php do_action('get_header'); ?>
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
<?php
/** WordPress view bootstrapper */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
ManifestNotFoundException
|
---|
Roots\Acorn\Assets\Contracts\ManifestNotFoundException: The manifest [/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/public/mix-manifest.json] cannot be found. at /srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:133 at Roots\Acorn\Assets\Manager->getJsonManifest('/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/public/mix-manifest.json') (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:101) at Roots\Acorn\Assets\Manager->resolve('theme', array('path' => '/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/public', 'url' => 'https://staging.ndncollective.org/app/themes/landback-2021/public', 'assets' => '/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/public/mix-manifest.json')) (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Roots/Acorn/Assets/Manager.php:76) at Roots\Acorn\Assets\Manager->manifest('theme') (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Roots/Acorn/Assets/AssetsServiceProvider.php:22) at Roots\Acorn\Assets\AssetsServiceProvider->Roots\Acorn\Assets\{closure}(object(Application), array()) (/srv/www/ndncollective.org/releases/20220627120132/vendor/illuminate/container/Container.php:873) at Illuminate\Container\Container->build(object(Closure)) (/srv/www/ndncollective.org/releases/20220627120132/vendor/illuminate/container/Container.php:758) at Illuminate\Container\Container->resolve('assets.manifest', array(), true) (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:851) at Illuminate\Foundation\Application->resolve('assets.manifest', array()) (/srv/www/ndncollective.org/releases/20220627120132/vendor/illuminate/container/Container.php:694) at Illuminate\Container\Container->make('assets.manifest', array()) (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:836) at Illuminate\Foundation\Application->make('assets.manifest', array()) (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php:119) at app('assets.manifest') (/srv/www/ndncollective.org/releases/20220627120132/vendor/roots/acorn/src/Roots/helpers.php:20) at Roots\asset('scripts/vendor.js') (/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/app/setup.php:17) at App\{closure}('') (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/class-wp-hook.php:307) at WP_Hook->apply_filters('', array('')) (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/class-wp-hook.php:331) at WP_Hook->do_action(array('')) (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/plugin.php:474) at do_action('wp_enqueue_scripts') (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/script-loader.php:2115) at wp_enqueue_scripts('') (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/class-wp-hook.php:307) at WP_Hook->apply_filters(null, array('')) (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/class-wp-hook.php:331) at WP_Hook->do_action(array('')) (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/plugin.php:474) at do_action('wp_head') (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/general-template.php:3042) at wp_head() (/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/index.php:7) at include('/srv/www/ndncollective.org/releases/20220627120132/web/app/themes/landback-2021/index.php') (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/template-loader.php:106) at require_once('/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-includes/template-loader.php') (/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-blog-header.php:19) at require('/srv/www/ndncollective.org/releases/20220627120132/web/wp/wp-blog-header.php') (/srv/www/ndncollective.org/releases/20220627120132/web/index.php:5) |