Plugin Directory

Changeset 3003157

Timestamp:
11/29/2023 09:31:22 AM (12 months ago)
Author:
PerS
Message:

Update to version 2.2.2 from GitHub

Location:
a-faster-load-textdomain
Files:
2 added
4 deleted
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • a-faster-load-textdomain/tags/2.2.2/a-faster-load-textdomain.php

    r3000370 r3003157  
    22/**
    33 * Plugin Name: A faster load_textdomain
    4  * Version: 2.2.1
     4 * Version: 2.2.
    55 * Description: Cache the .mo file as an PHP array, and load the array instead of the .mo file.
    66 * Author: Per Soderlind
     
    4949    }
    5050
    51     $cache_path    = apply_filters( 'a_faster_load_textdomain_cache_path', WP_CONTENT_DIR . '/cache/a-faster-load-textdomain' );
     51    // Apply filter to get cache path, default is 'WP_CONTENT_DIR/cache/a-faster-load-textdomain'.
     52    $cache_path = apply_filters( 'a_faster_load_textdomain_cache_path', WP_CONTENT_DIR . '/cache/a-faster-load-textdomain' );
     53
     54    // Create a new instance of the CacheHandler class.
    5255    $cache_handler = new \AFLD_CacheHandler( $cache_path, 'mo' );
    53     $data          = $cache_handler->get_cache_data( $mofile );
    5456
     57
     58
     59
     60
    5561    $mtime = filemtime( $mofile );
    56     $mo    = new \MO();
    5762
     63
     64
     65
     66
    5867    if ( ! $data || ! isset( $data['mtime'] ) || $mtime > $data['mtime'] ) {
     68
    5969        if ( ! $mo->import_from_file( $mofile ) ) {
    6070            return false;
    6171        }
    6272
     73
    6374        $data = [
    64             'mtime'   => $mtime,
    65             'file'    => $mofile,
    66             'entries' => $mo->entries,
    67             'headers' => $mo->headers,
     75            'mtime'   => $mtime,
     76            'file'    => $mofile,
     77            'entries' => $mo->entries,
     78            'headers' => $mo->headers,
    6879        ];
    6980
     81
    7082        $cache_handler->update_cache_data( $mofile, $data, __NAMESPACE__ . '\Translation_Entry' );
    7183    } else {
     84
    7285        $mo->entries = $data['entries'];
    7386        $mo->headers = $data['headers'];
  • a-faster-load-textdomain/tags/2.2.2/readme.txt

    r3000798 r3003157  
    55Requires PHP: 7.4
    66Tested up to: 6.4
    7 Stable tag: 2.2.1
     7Stable tag: 2.2.
    88Donate link: https://paypal.me/PerSoderlind
    99License: GPLv2 or later
     
    5959== Changelog ==
    6060
     61
     62
     63
     64
    6165= 2.2.1 =
    6266
  • a-faster-load-textdomain/trunk/a-faster-load-textdomain.php

    r3000370 r3003157  
    22/**
    33 * Plugin Name: A faster load_textdomain
    4  * Version: 2.2.1
     4 * Version: 2.2.
    55 * Description: Cache the .mo file as an PHP array, and load the array instead of the .mo file.
    66 * Author: Per Soderlind
     
    4949    }
    5050
    51     $cache_path    = apply_filters( 'a_faster_load_textdomain_cache_path', WP_CONTENT_DIR . '/cache/a-faster-load-textdomain' );
     51    // Apply filter to get cache path, default is 'WP_CONTENT_DIR/cache/a-faster-load-textdomain'.
     52    $cache_path = apply_filters( 'a_faster_load_textdomain_cache_path', WP_CONTENT_DIR . '/cache/a-faster-load-textdomain' );
     53
     54    // Create a new instance of the CacheHandler class.
    5255    $cache_handler = new \AFLD_CacheHandler( $cache_path, 'mo' );
    53     $data          = $cache_handler->get_cache_data( $mofile );
    5456
     57
     58
     59
     60
    5561    $mtime = filemtime( $mofile );
    56     $mo    = new \MO();
    5762
     63
     64
     65
     66
    5867    if ( ! $data || ! isset( $data['mtime'] ) || $mtime > $data['mtime'] ) {
     68
    5969        if ( ! $mo->import_from_file( $mofile ) ) {
    6070            return false;
    6171        }
    6272
     73
    6374        $data = [
    64             'mtime'   => $mtime,
    65             'file'    => $mofile,
    66             'entries' => $mo->entries,
    67             'headers' => $mo->headers,
     75            'mtime'   => $mtime,
     76            'file'    => $mofile,
     77            'entries' => $mo->entries,
     78            'headers' => $mo->headers,
    6879        ];
    6980
     81
    7082        $cache_handler->update_cache_data( $mofile, $data, __NAMESPACE__ . '\Translation_Entry' );
    7183    } else {
     84
    7285        $mo->entries = $data['entries'];
    7386        $mo->headers = $data['headers'];
  • a-faster-load-textdomain/trunk/readme.txt

    r3000798 r3003157  
    55Requires PHP: 7.4
    66Tested up to: 6.4
    7 Stable tag: 2.2.1
     7Stable tag: 2.2.
    88Donate link: https://paypal.me/PerSoderlind
    99License: GPLv2 or later
     
    5959== Changelog ==
    6060
     61
     62
     63
     64
    6165= 2.2.1 =
    6266
Note: See TracChangeset for help on using the changeset viewer.