/var/www/fxb-site/src/views/layouts/app.twig
<title>
{% if wp_title %}
{{ wp_title }}
-
{{ site.name }}
{% else %}
{{ site.name }}
{% endif %}
</title>
<meta name="description" content="{{ site.description }}">
<link rel="apple-touch-icon" href="{{ favicon }}">
<link rel="icon" href="{{ favicon }}">
<!--[if IE]>
<link rel="shortcut icon" href="{{ favicon }}">
<![endif]-->
<!-- Bootstrap core CSS -->
{{ function('wp_head') }}
</head>
<body>
{% include "components/nav/nav.twig" with {"url": function('get_permalink', post.meta('donate_url'))} %}
{# <a href="https://api.instagram.com/oauth/authorize?client_id=242055426815253&redirect_uri=https://fxb.walkingnerds.dev&scope=user_profile,user_media&response_type=code">test</a> #}
<!-- Begin page content -->
<main id="app" role="main">{% block content %}{% endblock %} </main>
{# {{function('dd', post)}} #}
{% if ( post.modules_footer is defined) %}
{# {% for module, data in post.modules_footer %}
{% include "modules/" ~ data.slug ~ ".twig" with {"module" : data} %}
{% endfor %} #}
{% endif %}
{% include "components/footer/footer.twig" %}
Arguments
"An exception has been thrown during the rendering of a template ("chmod(): Operation not permitted")."
/var/www/fxb-site/web/wp/wp-admin/includes/class-wp-filesystem-direct.php
* @param string $file Path to the file.
* @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
* 0755 for directories. Default false.
* @param bool $recursive Optional. If set to true, changes file permissions recursively.
* Default false.
* @return bool True on success, false on failure.
*/
public function chmod( $file, $mode = false, $recursive = false ) {
if ( ! $mode ) {
if ( $this->is_file( $file ) ) {
$mode = FS_CHMOD_FILE;
} elseif ( $this->is_dir( $file ) ) {
$mode = FS_CHMOD_DIR;
} else {
return false;
}
}
if ( ! $recursive || ! $this->is_dir( $file ) ) {
return chmod( $file, $mode );
}
// Is a directory, and we want recursive.
$file = trailingslashit( $file );
$filelist = $this->dirlist( $file );
foreach ( (array) $filelist as $filename => $filemeta ) {
$this->chmod( $file . $filename, $mode, $recursive );
}
return true;
}
/**
* Changes the owner of a file or directory.
*
* @since 2.5.0
*
* @param string $file Path to the file or directory.
* @param string|int $owner A user name or number.
Arguments
"chmod(): Operation not permitted"
/var/www/fxb-site/web/wp/wp-admin/includes/class-wp-filesystem-direct.php
* @param string $file Path to the file.
* @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
* 0755 for directories. Default false.
* @param bool $recursive Optional. If set to true, changes file permissions recursively.
* Default false.
* @return bool True on success, false on failure.
*/
public function chmod( $file, $mode = false, $recursive = false ) {
if ( ! $mode ) {
if ( $this->is_file( $file ) ) {
$mode = FS_CHMOD_FILE;
} elseif ( $this->is_dir( $file ) ) {
$mode = FS_CHMOD_DIR;
} else {
return false;
}
}
if ( ! $recursive || ! $this->is_dir( $file ) ) {
return chmod( $file, $mode );
}
// Is a directory, and we want recursive.
$file = trailingslashit( $file );
$filelist = $this->dirlist( $file );
foreach ( (array) $filelist as $filename => $filemeta ) {
$this->chmod( $file . $filename, $mode, $recursive );
}
return true;
}
/**
* Changes the owner of a file or directory.
*
* @since 2.5.0
*
* @param string $file Path to the file or directory.
* @param string|int $owner A user name or number.
/var/www/fxb-site/web/wp/wp-admin/includes/class-wp-filesystem-direct.php
if ( ! $fp ) {
return false;
}
mbstring_binary_safe_encoding();
$data_length = strlen( $contents );
$bytes_written = fwrite( $fp, $contents );
reset_mbstring_encoding();
fclose( $fp );
if ( $data_length !== $bytes_written ) {
return false;
}
$this->chmod( $file, $mode );
return true;
}
/**
* Gets the current working directory.
*
* @since 2.5.0
*
* @return string|false The current working directory on success, false on failure.
*/
public function cwd() {
return getcwd();
}
/**
* Changes current directory.
*
* @since 2.5.0
*
/var/www/fxb-site/web/app/plugins/popup-maker/classes/AssetCache.php
/**
* WP Filesystem.
*
* @var \WP_Filesystem_Base $wp_filesystem
*/
global $wp_filesystem;
if ( false === self::$cache_dir ) {
return false;
}
if ( ! function_exists( 'WP_Filesystem' ) ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
}
$file = trailingslashit( self::$cache_dir ) . $filename;
WP_Filesystem();
$results = $wp_filesystem->put_contents( $file, $contents, defined( 'FS_CHMOD_FILE' ) ? FS_CHMOD_FILE : false );
// If the file is generated and is accessible...
if ( true === $results && self::is_file_accessible( $filename ) ) {
return true;
} else {
// ... else, let's set our flags to prevent cache running again for now.
update_option( 'pum_files_writeable', false );
update_option( '_pum_writeable_notice_dismissed', false );
return false;
}
}
/**
* Generate Custom Styles
*
* @return string
*/
public static function generate_css() {
/**
* WP Filesystem.
/var/www/fxb-site/web/app/plugins/popup-maker/classes/AssetCache.php
update_option( 'pum-has-cached-js', strtotime( 'now' ) );
}
}
/**
* Generate CSS cache file.
*/
public static function cache_css() {
if ( false === self::$cache_dir ) {
return;
}
$css_file = self::generate_cache_filename( 'pum-site-styles' ) . '.css';
$css = "/**\n";
$css .= " * Do not touch this file! This file created by the Popup Maker plugin using PHP\n";
$css .= ' * Last modified time: ' . wp_date( 'M d Y, h:i:s' ) . "\n";
$css .= " */\n\n\n";
$css .= self::generate_css();
if ( ! self::cache_file( $css_file, $css ) ) {
update_option( 'pum-has-cached-css', false );
} else {
update_option( 'pum-has-cached-css', strtotime( 'now' ) );
}
}
/**
* Generate custom JS
*
* @return string
*/
public static function generate_js() {
/**
* Filesystem.
*
* @var \WP_Filesystem_Base $wp_filesystem
*/
global $wp_filesystem;
// Load core scripts so we can eliminate another stylesheet.
/var/www/fxb-site/web/app/plugins/popup-maker/classes/Site/Assets.php
$settings[ 'pum-' . $popup->ID ] = $popup->get_public_settings();
endwhile;
pum()->current_popup = $current_popup;
}
return $settings;
}
/**
* Register CSS.
*/
public static function register_styles() {
self::$styles_registered = true;
if ( PUM_AssetCache::enabled() && false !== self::$cache_url ) {
$cached = get_option( 'pum-has-cached-css' );
if ( ! $cached || self::$debug ) {
PUM_AssetCache::cache_css();
$cached = get_option( 'pum-has-cached-css' );
}
wp_register_style( 'popup-maker-site', self::$cache_url . '/' . PUM_AssetCache::generate_cache_filename( 'pum-site-styles' ) . '.css?generated=' . $cached, [], Popup_Maker::$VER );
} else {
wp_register_style( 'popup-maker-site', self::$css_url . 'pum-site' . ( is_rtl() ? '-rtl' : '' ) . self::$suffix . '.css', [], Popup_Maker::$VER );
self::inline_styles();
}
}
/**
* Render popup inline styles.
*/
public static function inline_styles() {
if ( ( current_action() === 'wp_head' && popmake_get_option( 'disable_popup_theme_styles', false ) ) || ( current_action() === 'admin_head' && ! popmake_is_admin_popup_page() ) ) {
return;
}
wp_add_inline_style( 'popup-maker-site', PUM_AssetCache::inline_css() );
}
/var/www/fxb-site/web/wp/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// 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, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/var/www/fxb-site/web/wp/wp-includes/class-wp-hook.php
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @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;
}
}
/**
* Processes the functions hooked into the 'all' hook.
*
* @since 4.7.0
*
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
*/
public function do_all_hook( &$args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = $this->priorities;
do {
$priority = current( $this->iterations[ $nesting_level ] );
/var/www/fxb-site/web/wp/wp-includes/plugin.php
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
if ( empty( $arg ) ) {
$arg[] = '';
} 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 );
}
/**
* Calls the callback functions that have been added to an action hook, specifying arguments in an array.
*
* @since 2.1.0
*
* @see do_action() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_actions Stores the number of times each action was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the action to be executed.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
*/
function do_action_ref_array( $hook_name, $args ) {
/var/www/fxb-site/web/wp/wp-includes/script-loader.php
* @since 2.8.0
*/
do_action( 'wp_print_footer_scripts' );
}
/**
* Wrapper for do_action( 'wp_enqueue_scripts' ).
*
* Allows plugins to queue scripts for the front end using wp_enqueue_script().
* Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.
*
* @since 2.8.0
*/
function wp_enqueue_scripts() {
/**
* 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.
*
* @since 2.8.0
*
* @global bool $concatenate_scripts
*
* @return array
*/
function print_admin_styles() {
global $concatenate_scripts;
$wp_styles = wp_styles();
script_concat_settings();
$wp_styles->do_concat = $concatenate_scripts;
$wp_styles->do_items( false );
/var/www/fxb-site/web/wp/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// 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, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/var/www/fxb-site/web/wp/wp-includes/class-wp-hook.php
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @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;
}
}
/**
* Processes the functions hooked into the 'all' hook.
*
* @since 4.7.0
*
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
*/
public function do_all_hook( &$args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = $this->priorities;
do {
$priority = current( $this->iterations[ $nesting_level ] );
/var/www/fxb-site/web/wp/wp-includes/plugin.php
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
if ( empty( $arg ) ) {
$arg[] = '';
} 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 );
}
/**
* Calls the callback functions that have been added to an action hook, specifying arguments in an array.
*
* @since 2.1.0
*
* @see do_action() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_actions Stores the number of times each action was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the action to be executed.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
*/
function do_action_ref_array( $hook_name, $args ) {
/var/www/fxb-site/web/wp/wp-includes/general-template.php
* @param string $before The HTML to output before the date.
* @param string $after The HTML to output after the date.
*/
echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );
}
/**
* Fires the wp_head action.
*
* See {@see 'wp_head'}.
*
* @since 1.2.0
*/
function wp_head() {
/**
* Prints scripts or data in the head tag on the front end.
*
* @since 1.5.0
*/
do_action( 'wp_head' );
}
/**
* Fires the wp_footer action.
*
* See {@see 'wp_footer'}.
*
* @since 1.5.1
*/
function wp_footer() {
/**
* Prints scripts or data before the closing body tag on the front end.
*
* @since 1.5.1
*/
do_action( 'wp_footer' );
}
/**
* Fires the wp_body_open action.
/var/www/fxb-site/vendor/timber/timber/lib/Twig.php
if ( is_array($arr) ) {
return $arr;
}
$arr = array($arr);
return $arr;
}
/**
*
*
* @param string $function_name
* @return mixed
*/
public function exec_function( $function_name ) {
$args = func_get_args();
array_shift($args);
if ( is_string($function_name) ) {
$function_name = trim($function_name);
}
return call_user_func_array($function_name, ($args));
}
/**
*
*
* @param string $content
* @return string
*/
public function twig_pretags( $content ) {
return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
}
/**
*
*
* @param array $matches
* @return string
*/
public function convert_pre_entities( $matches ) {
return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
/var/www/fxb-site/vendor/timber/timber/lib/Twig.php
if ( is_array($arr) ) {
return $arr;
}
$arr = array($arr);
return $arr;
}
/**
*
*
* @param string $function_name
* @return mixed
*/
public function exec_function( $function_name ) {
$args = func_get_args();
array_shift($args);
if ( is_string($function_name) ) {
$function_name = trim($function_name);
}
return call_user_func_array($function_name, ($args));
}
/**
*
*
* @param string $content
* @return string
*/
public function twig_pretags( $content ) {
return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
}
/**
*
*
* @param array $matches
* @return string
*/
public function convert_pre_entities( $matches ) {
return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
/var/www/fxb-site/vendor/twig/twig/src/Environment.php
$key = $this->cache->generateKey($name, $mainCls);
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
$source = null;
if (!class_exists($cls, false)) {
$source = $this->getLoader()->getSourceContext($name);
$content = $this->compileSource($source);
$this->cache->write($key, $content);
$this->cache->load($key);
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
if (!class_exists($cls, false)) {
throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
}
// to be removed in 3.0
$this->extensionSet->initRuntime($this);
return $this->loadedTemplates[$cls] = new $cls($this);
}
/**
* Creates a template from source.
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template source
/var/www/fxb-site/vendor/twig/twig/src/Template.php
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
$e->guess();
throw $e;
}
}
/var/www/fxb-site/vendor/twig/twig/src/Template.php
{
return $this;
}
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*/
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
/var/www/fxb-site/vendor/twig/twig/src/Environment.php
$key = $this->cache->generateKey($name, $mainCls);
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
$source = null;
if (!class_exists($cls, false)) {
$source = $this->getLoader()->getSourceContext($name);
$content = $this->compileSource($source);
$this->cache->write($key, $content);
$this->cache->load($key);
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
if (!class_exists($cls, false)) {
throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
}
// to be removed in 3.0
$this->extensionSet->initRuntime($this);
return $this->loadedTemplates[$cls] = new $cls($this);
}
/**
* Creates a template from source.
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template source
/var/www/fxb-site/vendor/twig/twig/src/Template.php
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
$e->guess();
throw $e;
}
}
/var/www/fxb-site/vendor/twig/twig/src/Template.php
{
return $this;
}
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*/
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
/var/www/fxb-site/vendor/twig/twig/src/Template.php
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
/var/www/fxb-site/vendor/twig/twig/src/TemplateWrapper.php
* directly (use Twig\Environment::load() instead).
*
* @internal
*/
public function __construct(Environment $env, Template $template)
{
$this->env = $env;
$this->template = $template;
}
/**
* Renders the template.
*
* @param array $context An array of parameters to pass to the template
*/
public function render(array $context = []): string
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_get_args()[1] ?? []);
}
/**
* Displays the template.
*
* @param array $context An array of parameters to pass to the template
*/
public function display(array $context = [])
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
$this->template->display($context, \func_get_args()[1] ?? []);
}
/**
* Checks if a block is defined.
*
* @param string $name The block name
* @param array $context An array of parameters to pass to the template
*/
/var/www/fxb-site/vendor/timber/timber/lib/Loader.php
$key = null;
$output = false;
if ( false !== $expires ) {
ksort($data);
$key = md5($file.json_encode($data));
$output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
}
if ( false === $output || null === $output ) {
$twig = $this->get_twig();
if ( strlen($file) ) {
$loader = $this->get_loader();
$result = $loader->getCacheKey($file);
do_action('timber_loader_render_file', $result);
}
$data = apply_filters('timber_loader_render_data', $data);
$data = apply_filters('timber/loader/render_data', $data, $file);
$template = $twig->load($file);
$output = $template->render($data);
}
if ( false !== $output && false !== $expires && null !== $key ) {
$this->delete_cache();
$this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
}
$output = apply_filters('timber_output', $output);
return apply_filters('timber/output', $output, $data, $file);
}
protected function delete_cache() {
Cleaner::delete_transients();
}
/**
* Get first existing template.
*
* @param array|string $templates Name(s) of the Twig template(s) to choose from.
* @return string|bool Name of chosen template, otherwise false.
*/
/var/www/fxb-site/vendor/timber/timber/lib/Timber.php
if ( $via_render ) {
$file = apply_filters('timber_render_file', $file);
} else {
$file = apply_filters('timber_compile_file', $file);
}
$output = false;
if ($file !== false) {
if ( is_null($data) ) {
$data = array();
}
if ( $via_render ) {
$data = apply_filters('timber_render_data', $data);
} else {
$data = apply_filters('timber_compile_data', $data);
}
$output = $loader->render($file, $data, $expires, $cache_mode);
} else {
if ( is_array($filenames) ) {
$filenames = implode(", ", $filenames);
}
Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
}
do_action('timber_compile_done');
return $output;
}
/**
* Compile a string.
*
* @api
* @example
* ```php
* $data = array(
* 'username' => 'Jane Doe',
* );
/var/www/fxb-site/vendor/timber/timber/lib/Timber.php
$twig = $dummy_loader->get_twig();
$template = $twig->createTemplate($string);
return $template->render($data);
}
/**
* Fetch function.
*
* @api
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* array, the first value is used for non-logged in visitors, the second for users.
* Default false.
* @param string $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
* @return bool|string The returned output.
*/
public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
$output = self::compile($filenames, $data, $expires, $cache_mode, true);
$output = apply_filters('timber_compile_result', $output);
return $output;
}
/**
* Render function.
*
* Passes data to a Twig file and echoes the output.
*
* @api
* @example
* ```php
* $context = Timber::context();
*
* Timber::render( 'index.twig', $context );
* ```
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
/var/www/fxb-site/vendor/timber/timber/lib/Timber.php
* Passes data to a Twig file and echoes the output.
*
* @api
* @example
* ```php
* $context = Timber::context();
*
* Timber::render( 'index.twig', $context );
* ```
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* array, the first value is used for non-logged in visitors, the second for users.
* Default false.
* @param string $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
* @return bool|string The echoed output.
*/
public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
$output = self::fetch($filenames, $data, $expires, $cache_mode);
echo $output;
return $output;
}
/**
* Render a string with Twig variables.
*
* @api
* @example
* ```php
* $data = array(
* 'username' => 'Jane Doe',
* );
*
* Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
* ```
* @param string $string A string with Twig variables.
* @param array $data An array of data to use in Twig template.
* @return bool|string
*/
/var/www/fxb-site/web/app/themes/fxb/archive.php
use App\Modules\ModuleLoader;
$context = Timber::get_context();
$context['post'] = new Page();
// $context = new Timber\Image;
$about_us = new ModuleLoader("about-us");
$news = new ModuleLoader("news");
$context['post']->modules_footer = [
[
"slug" => "about-us",
"acf_data" => $about_us->acf_data
],
// [
// "slug" => "news",
// "acf_data" => $news->acf_data,
// "module_data" => $news->module_data,
// ]
];
Timber::render(['templates/hero-grid.twig', 'page.twig'], $context);
/var/www/fxb-site/web/wp/wp-includes/template-loader.php
}
break;
}
}
if ( ! $template ) {
$template = get_index_template();
}
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @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() );
}
}
return;
}
Arguments
"/var/www/fxb-site/web/app/themes/fxb/archive.php"
/var/www/fxb-site/web/wp/wp-blog-header.php
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
Arguments
"/var/www/fxb-site/web/wp/wp-includes/template-loader.php"
/var/www/fxb-site/web/index.php
<?php
/** WordPress view bootstrapper */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
Arguments
"/var/www/fxb-site/web/wp/wp-blog-header.php"