Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter danielflippance

    (@danielflippance)

    To get the debug log viewer to work in Bedrock, I had to make the following 2 changes:

    config/application.php:

    
    define('BEDROCK_WEBROOT', dirname(__DIR__) . '/web');
    

    web/app/plugins/wp-super-cache/wp-cache.php line 2128:

    
    // $log_file_link = "<a href='" . site_url( str_replace( ABSPATH, '', "{$cache_path}view_{$wp_cache_debug_log}?wp-admin=1&wp-json=1&filter=" ) ) . "'>$wp_cache_debug_log</a>";
    if (defined('BEDROCK_WEBROOT')) {
    	$log_file_link = "<a href='" . home_url( str_replace( BEDROCK_WEBROOT, '', "{$cache_path}view_{$wp_cache_debug_log}?wp-admin=1&wp-json=1&filter=" ) ) . "'>$wp_cache_debug_log</a>";
    } else {
    	$log_file_link = "<a href='" . site_url( str_replace( ABSPATH, '', "{$cache_path}view_{$wp_cache_debug_log}?wp-admin=1&wp-json=1&filter=" ) ) . "'>$wp_cache_debug_log</a>";
    }
    
    Thread Starter danielflippance

    (@danielflippance)

    Cache location is set to: /home/myusername/public_html/web/app/cache/

    Thread Starter danielflippance

    (@danielflippance)

    I also had to add these lines at the top of web/app/wp-cache-config.php:

    
    //Make it work with Bedrock
    //$wp_cache_home_path = '/wp/';
    if (defined('ABSPATH')) {
        $wp_cache_home_path = ABSPATH;
    } else {
        $wp_cache_home_path = '/wp/';
    }
    
    $wp_cache_slash_check = 1;
    
    • This reply was modified 6 years, 7 months ago by danielflippance. Reason: The code change was actually an addition, not a replacement
    Thread Starter danielflippance

    (@danielflippance)

    Yes, I’ve done that. The cache works but the preload does not.

    define('WPCACHEHOME', '/Users/myuser/myproject/web/app/plugins/wp-super-cache

    To get the cache to work I had to modify line 631 of the file web/app/plugins/wp-super-cache/wp-cache-phase2.php as follows:

    
        //$site_url = site_url();
        //In Bedrock, site_url() returns www.domain.com/wp
        //See https://github.com/pressbooks/pressbooks/pull/971
        $site_url = home_url();
    

    Perhaps there is a similar change I need to make in the preload code?

Viewing 4 replies - 1 through 4 (of 4 total)