Changeset 3003157
- Timestamp:
- 11/29/2023 09:31:22 AM (12 months ago)
- 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 2 2 /** 3 3 * Plugin Name: A faster load_textdomain 4 * Version: 2.2. 14 * Version: 2.2. 5 5 * Description: Cache the .mo file as an PHP array, and load the array instead of the .mo file. 6 6 * Author: Per Soderlind … … 49 49 } 50 50 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. 52 55 $cache_handler = new \AFLD_CacheHandler( $cache_path, 'mo' ); 53 $data = $cache_handler->get_cache_data( $mofile );54 56 57 58 59 60 55 61 $mtime = filemtime( $mofile ); 56 $mo = new \MO();57 62 63 64 65 66 58 67 if ( ! $data || ! isset( $data['mtime'] ) || $mtime > $data['mtime'] ) { 68 59 69 if ( ! $mo->import_from_file( $mofile ) ) { 60 70 return false; 61 71 } 62 72 73 63 74 $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, 68 79 ]; 69 80 81 70 82 $cache_handler->update_cache_data( $mofile, $data, __NAMESPACE__ . '\Translation_Entry' ); 71 83 } else { 84 72 85 $mo->entries = $data['entries']; 73 86 $mo->headers = $data['headers']; -
a-faster-load-textdomain/tags/2.2.2/readme.txt
r3000798 r3003157 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.4 7 Stable tag: 2.2. 17 Stable tag: 2.2. 8 8 Donate link: https://paypal.me/PerSoderlind 9 9 License: GPLv2 or later … … 59 59 == Changelog == 60 60 61 62 63 64 61 65 = 2.2.1 = 62 66 -
a-faster-load-textdomain/trunk/a-faster-load-textdomain.php
r3000370 r3003157 2 2 /** 3 3 * Plugin Name: A faster load_textdomain 4 * Version: 2.2. 14 * Version: 2.2. 5 5 * Description: Cache the .mo file as an PHP array, and load the array instead of the .mo file. 6 6 * Author: Per Soderlind … … 49 49 } 50 50 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. 52 55 $cache_handler = new \AFLD_CacheHandler( $cache_path, 'mo' ); 53 $data = $cache_handler->get_cache_data( $mofile );54 56 57 58 59 60 55 61 $mtime = filemtime( $mofile ); 56 $mo = new \MO();57 62 63 64 65 66 58 67 if ( ! $data || ! isset( $data['mtime'] ) || $mtime > $data['mtime'] ) { 68 59 69 if ( ! $mo->import_from_file( $mofile ) ) { 60 70 return false; 61 71 } 62 72 73 63 74 $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, 68 79 ]; 69 80 81 70 82 $cache_handler->update_cache_data( $mofile, $data, __NAMESPACE__ . '\Translation_Entry' ); 71 83 } else { 84 72 85 $mo->entries = $data['entries']; 73 86 $mo->headers = $data['headers']; -
a-faster-load-textdomain/trunk/readme.txt
r3000798 r3003157 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.4 7 Stable tag: 2.2. 17 Stable tag: 2.2. 8 8 Donate link: https://paypal.me/PerSoderlind 9 9 License: GPLv2 or later … … 59 59 == Changelog == 60 60 61 62 63 64 61 65 = 2.2.1 = 62 66
Note: See TracChangeset
for help on using the changeset viewer.