Ejemplo n.º 1
0
                    fwrite($config_file, $contents, strlen($contents));
                    fclose($config_file);
                    // remove any files that are marked to be removed, now that we have successfully written them to the new location, and pointed DOMPDF at them
                    /* skip this for now */
                    /*
                    if ( is_array( $remove_files ) && count( $remove_files ) )
                    	foreach ( $remove_files as $remove_file )
                    		if ( is_writable( $remove_file ) && ! is_dir( $remove_file ) && ! is_link( $remove_file ) )
                    			@unlink( $remove_file );
                    */
                }
            }
        }
    }
    if (defined('ABSPATH') && function_exists('add_action')) {
        QSOT_pdf::pre_init();
    }
}
if (!class_exists('QSOT_cache_helper')) {
    class QSOT_cache_helper
    {
        // cached asset map, original_url => local_file_path
        protected static $cache_map = array();
        // cache path
        protected static $cache_path = false;
        // is this a force recache?
        protected static $force_recache = null;
        // figure out the local path of the asset, based on the found url
        public static function find_local_path($url)
        {
            static $local = false, $local_url = false, $whats_old_in_seconds = false;