explode( ':', $meta_line, 2 ) );
$this->headers[ strtolower( $name ) ] = $value;
}
} else {
/*
* In MO files, the key normally contains both singular and plural versions.
* However, this just adds the singular string for lookup,
* which caters for cases where both __( 'Product' ) and _n( 'Product', 'Products' )
* are used and the translation is expected to be the same for both.
*/
$parts = explode( "\0", (string) $original );
$this->entries[ $parts[0] ] = $translation;
}
}
return true;
}
/**
* Exports translation contents as a string.
*
* @since 6.5.0
*
* @return string Translation file contents.
*/
public function export(): string {
// Prefix the headers as the first key.
$headers_string = '';
foreach ( $this->headers as $header => $value ) {
$headers_string .= "{$header}: $value\n";
}
$entries = array_merge( array( '' => $headers_string ), $this->entries );
$entry_count = count( $entries );
if ( false === $this->uint32 ) {
$this->uint32 = 'V';
}
$bytes_for_entries = $entry_count * 4 * 2;
// Pair of 32bit ints per entry.
$originals_addr = 28; /* header */
$translations_addr = $originals_addr + $bytes_for_entries;
$hash_addr = $translations_addr + $bytes_for_entries;
$entry_offsets = $hash_addr;
$file_header = pack(
$this->uint32 . '*',
// Force cast to an integer as it can be a float on x86 systems. See https://core.trac.wordpress.org/ticket/60678.
(int) self::MAGIC_MARKER,
0, /* rev */
$entry_count,
$originals_addr,
$translations_addr,
0, /* hash_length */
$hash_addr
);
$o_entries = '';
$t_entries = '';
$o_addr = '';
$t_addr = '';
foreach ( array_keys( $entries ) as $original ) {
$o_addr .= pack( $this->uint32 . '*', strlen( $original ), $entry_offsets );
$entry_offsets += strlen( $original ) + 1;
$o_entries .= $original . "\0";
}
foreach ( $entries as $translations ) {
$t_addr .= pack( $this->uint32 . '*', strlen( $translations ), $entry_offsets );
$entry_offsets += strlen( $translations ) + 1;
$t_entries .= $translations . "\0";
}
return $file_header . $o_addr . $t_addr . $o_entries . $t_entries;
}
}
Fatal error: require(): Failed opening required '/home/kordian1/domains/ostrabrama.pl/public_html/wp-includes/post.php' (include_path='.:/opt/alt/php74/usr/share/pear') in /home/kordian1/domains/ostrabrama.pl/public_html/wp-settings.php on line 213
Fatal error: Uncaught Error: Call to a member function set() on null in /home/kordian1/domains/ostrabrama.pl/public_html/wp-includes/l10n.php:856
Stack trace:
#0 /home/kordian1/domains/ostrabrama.pl/public_html/wp-includes/l10n.php(959): load_textdomain('default', '/home/kordian1/...', 'pl_PL')
#1 /home/kordian1/domains/ostrabrama.pl/public_html/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /home/kordian1/domains/ostrabrama.pl/public_html/wp-includes/l10n.php on line 856