Whoops \ Exception \ ErrorException (E_WARNING)
readfile(/home/forge/cruise.visitbelfast.work/public/app/uploads/2019/08/Belfast-City-Guide-Summer-2019.pdf): Failed to open stream: No such file or directory Whoops\Exception\ErrorException thrown with message "readfile(/home/forge/cruise.visitbelfast.work/public/app/uploads/2019/08/Belfast-City-Guide-Summer-2019.pdf): Failed to open stream: No such file or directory" Stacktrace: #7 Whoops\Exception\ErrorException in /home/forge/cruise.visitbelfast.work/public/app/Core/Providers/DocumentLibraryServiceProvider.php:140 #6 readfile in /home/forge/cruise.visitbelfast.work/public/app/Core/Providers/DocumentLibraryServiceProvider.php:140 #5 Hailstone\Core\Providers\DocumentLibraryServiceProvider:Hailstone\Core\Providers\{closure} in /home/forge/cruise.visitbelfast.work/public/wp/wp-includes/class-wp-hook.php:324 #4 WP_Hook:apply_filters in /home/forge/cruise.visitbelfast.work/public/wp/wp-includes/class-wp-hook.php:348 #3 WP_Hook:do_action in /home/forge/cruise.visitbelfast.work/public/wp/wp-includes/plugin.php:517 #2 do_action in /home/forge/cruise.visitbelfast.work/public/wp/wp-includes/template-loader.php:13 #1 require_once in /home/forge/cruise.visitbelfast.work/public/wp/wp-blog-header.php:19 #0 require in /home/forge/cruise.visitbelfast.work/public/index.php:25
Stack frames (8)
7
Whoops\Exception\ErrorException
/public/app/Core/Providers/DocumentLibraryServiceProvider.php140
6
readfile
/public/app/Core/Providers/DocumentLibraryServiceProvider.php140
5
Hailstone\Core\Providers\DocumentLibraryServiceProvider Hailstone\Core\Providers\{closure}
/public/wp/wp-includes/class-wp-hook.php324
4
WP_Hook apply_filters
/public/wp/wp-includes/class-wp-hook.php348
3
WP_Hook do_action
/public/wp/wp-includes/plugin.php517
2
do_action
/public/wp/wp-includes/template-loader.php13
1
require_once
/public/wp/wp-blog-header.php19
0
require
/public/index.php25
/home/forge/cruise.visitbelfast.work/public/app/Core/Providers/DocumentLibraryServiceProvider.php
 
                if(stristr($_SERVER['HTTP_USER_AGENT'],'iPhone') || stristr($_SERVER['HTTP_USER_AGENT'],'iPad') || stristr($_SERVER['HTTP_USER_AGENT'],'android') ) {
                    //wp_redirect( $attachment['url'] );
                    wp_redirect( $attachment->url() );
                    exit;
                }
 
                header("Pragma: public");
                header("Expires: 0");
                header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                header("Cache-Control: public");
                header("Content-Description: File Transfer");
                header("Content-type: application/".$attachment->mime."");
                //header("Content-Disposition: inline; filename=\"".$title."\"");
                header("Content-Disposition: attachment; filename=\"".$attachment->filename."\"");
                header("Content-Transfer-Encoding: binary");
                header("Content-Length: ".$attachment->size);
                ob_clean();
                flush();
                readfile($attachment->relativePath());
                exit;
            }
        });
    }
 
    /**
     *
     */
    private function addAttachmentDate()
    {
        add_filter('attachment_fields_to_edit', function($form_fields, $post) {
            $form_fields["post_date"]["tr"] = "
                <th scope='row' class='label'><label for='attachments[" . $post->ID . "][post_date]' name='attachments[" . $post->ID . "][post_date]'><span class='alignleft'>Set File Date:</span><br class='clear'></label></th>
                <tr id='date-picker'>
                    <td>
                        <input type='date' id='attachments[" . $post->ID . "][post_date]' name='attachments[" . $post->ID . "][post_date]' value='" . mysql2date('Y-m-d', $post->post_date) . "'/>
                    </td>
                </tr>";
            return $form_fields;
        }, 10, 2);
Arguments
  1. "readfile(/home/forge/cruise.visitbelfast.work/public/app/uploads/2019/08/Belfast-City-Guide-Summer-2019.pdf): Failed to open stream: No such file or directory"
    
/home/forge/cruise.visitbelfast.work/public/app/Core/Providers/DocumentLibraryServiceProvider.php
 
                if(stristr($_SERVER['HTTP_USER_AGENT'],'iPhone') || stristr($_SERVER['HTTP_USER_AGENT'],'iPad') || stristr($_SERVER['HTTP_USER_AGENT'],'android') ) {
                    //wp_redirect( $attachment['url'] );
                    wp_redirect( $attachment->url() );
                    exit;
                }
 
                header("Pragma: public");
                header("Expires: 0");
                header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                header("Cache-Control: public");
                header("Content-Description: File Transfer");
                header("Content-type: application/".$attachment->mime."");
                //header("Content-Disposition: inline; filename=\"".$title."\"");
                header("Content-Disposition: attachment; filename=\"".$attachment->filename."\"");
                header("Content-Transfer-Encoding: binary");
                header("Content-Length: ".$attachment->size);
                ob_clean();
                flush();
                readfile($attachment->relativePath());
                exit;
            }
        });
    }
 
    /**
     *
     */
    private function addAttachmentDate()
    {
        add_filter('attachment_fields_to_edit', function($form_fields, $post) {
            $form_fields["post_date"]["tr"] = "
                <th scope='row' class='label'><label for='attachments[" . $post->ID . "][post_date]' name='attachments[" . $post->ID . "][post_date]'><span class='alignleft'>Set File Date:</span><br class='clear'></label></th>
                <tr id='date-picker'>
                    <td>
                        <input type='date' id='attachments[" . $post->ID . "][post_date]' name='attachments[" . $post->ID . "][post_date]' value='" . mysql2date('Y-m-d', $post->post_date) . "'/>
                    </td>
                </tr>";
            return $form_fields;
        }, 10, 2);
/home/forge/cruise.visitbelfast.work/public/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.
/home/forge/cruise.visitbelfast.work/public/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 ] );
/home/forge/cruise.visitbelfast.work/public/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 ) {
/home/forge/cruise.visitbelfast.work/public/wp/wp-includes/template-loader.php
<?php
/**
 * Loads the correct template based on the visitor's url
 *
 * @package WordPress
 */
if ( wp_using_themes() ) {
    /**
     * Fires before determining which template to load.
     *
     * @since 1.5.0
     */
    do_action( 'template_redirect' );
}
 
/**
 * Filters whether to allow 'HEAD' requests to generate content.
 *
 * Provides a significant performance bump by exiting before the page
 * content loads for 'HEAD' requests. See #14348.
 *
 * @since 3.5.0
 *
 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
 */
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
    exit;
}
 
// Process feeds and trackbacks even if not using themes.
if ( is_robots() ) {
    /**
     * Fired when the template loader determines a robots.txt request.
     *
     * @since 2.1.0
     */
    do_action( 'do_robots' );
    return;
} elseif ( is_favicon() ) {
    /**
/home/forge/cruise.visitbelfast.work/public/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
  1. "/home/forge/cruise.visitbelfast.work/public/wp/wp-includes/template-loader.php"
    
/home/forge/cruise.visitbelfast.work/public/index.php
|--------------------------------------------------------------------------
|
| This would only be set to false, if, for some reason, you're using
| this as a child theme. In 99.99% of cases, leave this alone.
|
*/
 
define('WP_USE_THEMES', true);
 
/*
|--------------------------------------------------------------------------
| Bootstrap Wordpress
|--------------------------------------------------------------------------
|
| Load in the Wordpress boostrapper. This automatically looks for
| and loads wp-config.php. More magic happens in there.
|
*/
 
require(dirname(__FILE__) . '/wp/wp-blog-header.php');
Arguments
  1. "/home/forge/cruise.visitbelfast.work/public/wp/wp-blog-header.php"
    

Environment & details:

Key Value
download
"file"
file
"292"
empty
empty
Key Value
PHPSESSID
"h8otit0q8r8h4ndiibestv5f0h"
Key Value
token
"52a93840a581df0a9786f4d4ba35d6c45fb1eccc4582f78c0128cb5502f3dc61"
Key Value
SERVER_SOFTWARE
"nginx/1.22.1"
REQUEST_URI
"/?download=file&file=292"
USER
"forge"
HOME
"/home/forge"
HTTP_COOKIE
"PHPSESSID=h8otit0q8r8h4ndiibestv5f0h"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"cruise.visitbelfast.work"
REDIRECT_STATUS
"200"
HTTPS
"on"
SERVER_NAME
"cruise.visitbelfast.work"
SERVER_PORT
"443"
SERVER_ADDR
"188.166.150.253"
REMOTE_PORT
"30319"
REMOTE_ADDR
"216.73.216.14"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/2.0"
DOCUMENT_ROOT
"/home/forge/cruise.visitbelfast.work/public"
DOCUMENT_URI
"/index.php"
SCRIPT_NAME
"/index.php"
SCRIPT_FILENAME
"/home/forge/cruise.visitbelfast.work/public/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
"download=file&file=292"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1757519705.5005
REQUEST_TIME
1757519705
APP_DEBUG
"true"
APP_ENV
"staging"
APP_URL
"https://cruise.visitbelfast.work"
APP_STAGING_URL
"http://cruise-belfast.local"
APP_LIVE_URL
"https://cruise-belfast.co.uk"
DB_NAME
"cruise_staging"
DB_USER
"cruise_staging"
DB_PASSWORD
"Q1s3f4n2l900A"
DB_HOST
"localhost"
DB_PREFIX
"vbCB_"
AUTH_KEY
""
SECURE_AUTH_KEY
""
LOGGED_IN_KEY
""
NONCE_KEY
""
AUTH_SALT
""
SECURE_AUTH_SALT
""
LOGGED_IN_SALT
""
NONCE_SALT
""
S3_REGION
""
S3_BUCKET
""
S3_KEY
""
S3_SECRET
""
GOOGLE_API_KEY
"AIzaSyDk48Yv4-O4h8rpp1wmfI7T_YYsIKxhzdc"
GOOGLE_ANALYTICS_TAG
"UA-7279725-3"
MAILCHIMP_API_KEY
"7f442134aae6413abab03168c6200bf4-us8"
MAILCHIMP_LIST_ID
"e124f58681"
FONT_AWESOME_KIT
"b94325123b"
Key Value
APP_DEBUG
"true"
APP_ENV
"staging"
APP_URL
"https://cruise.visitbelfast.work"
APP_STAGING_URL
"http://cruise-belfast.local"
APP_LIVE_URL
"https://cruise-belfast.co.uk"
DB_NAME
"cruise_staging"
DB_USER
"cruise_staging"
DB_PASSWORD
"Q1s3f4n2l900A"
DB_HOST
"localhost"
DB_PREFIX
"vbCB_"
AUTH_KEY
""
SECURE_AUTH_KEY
""
LOGGED_IN_KEY
""
NONCE_KEY
""
AUTH_SALT
""
SECURE_AUTH_SALT
""
LOGGED_IN_SALT
""
NONCE_SALT
""
S3_REGION
""
S3_BUCKET
""
S3_KEY
""
S3_SECRET
""
GOOGLE_API_KEY
"AIzaSyDk48Yv4-O4h8rpp1wmfI7T_YYsIKxhzdc"
GOOGLE_ANALYTICS_TAG
"UA-7279725-3"
MAILCHIMP_API_KEY
"7f442134aae6413abab03168c6200bf4-us8"
MAILCHIMP_LIST_ID
"e124f58681"
FONT_AWESOME_KIT
"b94325123b"
0. Whoops\Handler\PrettyPageHandler