all repos — wp-ffpc @ b5cde93bee6465008f5b9636673b804a6f2d6b5e

precache working
Peter Molnar hello@petermolnar.eu
Tue, 26 Mar 2013 17:41:58 +0000
commit

b5cde93bee6465008f5b9636673b804a6f2d6b5e

parent

1a726f01eb3c97a5efae983bdb7cc6c769544f4d

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M wp-ffpc-class.phpwp-ffpc-class.php

@@ -786,10 +786,12 @@ $this->precache_list_permalinks ( $links, $blog['blog_id'] );

} } else { - $links = $this->precache_list_permalinks ( $links, false ); + $this->precache_list_permalinks ( $links, false ); } $tmpfile = tempnam(sys_get_temp_dir(), 'wp-ffpc'); + + if ( !empty ( $links ) ) : $out .= '<?php $links = ' . var_export ( $links , true ) . ';

@@ -815,6 +817,8 @@

file_put_contents ( $tmpfile, $out ); $shellfunction = $this->shell_function; $shellfunction( 'php '. $tmpfile .' >'. $this->precache_logfile .' 2>&1 &' ); + + endif; }

@@ -824,10 +828,10 @@ *

*/ private function precache_list_permalinks ( &$links, $site = false ) { global $post; - $current_blog = get_current_blog_id(); include_once ( ABSPATH . "wp-load.php" ); if ( $site !== false ) { + $current_blog = get_current_blog_id(); switch_to_blog( $site ); }