Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
wp /
vendor /
wp-cli /
i18n-command /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
BladeCodeExtractor.php
1.88
KB
-rw-r--r--
BladeGettextExtractor.php
1.4
KB
-rw-r--r--
BlockExtractor.php
914
B
-rw-r--r--
CommandNamespace.php
406
B
-rw-r--r--
FileDataExtractor.php
2.23
KB
-rw-r--r--
IterableCodeExtractor.php
11.24
KB
-rw-r--r--
JedGenerator.php
2.11
KB
-rw-r--r--
JsCodeExtractor.php
1.74
KB
-rw-r--r--
JsFunctionsScanner.php
11.79
KB
-rw-r--r--
JsonSchemaExtractor.php
4.76
KB
-rw-r--r--
MakeJsonCommand.php
12.62
KB
-rw-r--r--
MakeMoCommand.php
3.03
KB
-rw-r--r--
MakePhpCommand.php
2.33
KB
-rw-r--r--
MakePotCommand.php
31.8
KB
-rw-r--r--
MapCodeExtractor.php
1.62
KB
-rw-r--r--
PhpArrayGenerator.php
4.1
KB
-rw-r--r--
PhpCodeExtractor.php
1.9
KB
-rw-r--r--
PhpFunctionsScanner.php
2.52
KB
-rw-r--r--
PotGenerator.php
3.88
KB
-rw-r--r--
UpdatePoCommand.php
2.71
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : UpdatePoCommand.php
<?php namespace WP_CLI\I18n; use DirectoryIterator; use Gettext\Extractors\Po; use Gettext\Merge; use Gettext\Translations; use IteratorIterator; use SplFileInfo; use WP_CLI; use WP_CLI\Utils; use WP_CLI_Command; class UpdatePoCommand extends WP_CLI_Command { /** * Update PO files from a POT file. * * This behaves similarly to the [msgmerge](https://www.gnu.org/software/gettext/manual/html_node/msgmerge-Invocation.html) command. * * ## OPTIONS * * <source> * : Path to an existing POT file to use for updating. * * [<destination>] * : PO file to update or a directory containing multiple PO files. * Defaults to all PO files in the source directory. * * ## EXAMPLES * * # Update all PO files from a POT file in the current directory. * $ wp i18n update-po example-plugin.pot * Success: Updated 3 files. * * # Update a PO file from a POT file. * $ wp i18n update-po example-plugin.pot example-plugin-de_DE.po * Success: Updated 1 file. * * # Update all PO files in a given directory from a POT file. * $ wp i18n update-po example-plugin.pot languages * Success: Updated 2 files. * * @when before_wp_load * * @throws WP_CLI\ExitException */ public function __invoke( $args, $assoc_args ) { $source = realpath( $args[0] ); if ( ! $source || ! is_file( $source ) ) { WP_CLI::error( 'Source file does not exist.' ); } $destination = dirname( $source ); if ( isset( $args[1] ) ) { $destination = $args[1]; } if ( ! file_exists( $destination ) ) { WP_CLI::error( 'Destination file/folder does not exist.' ); } if ( is_file( $destination ) ) { $files = [ new SplFileInfo( $destination ) ]; } else { $files = new IteratorIterator( new DirectoryIterator( $destination ) ); } $pot_translations = Translations::fromPoFile( $source ); $result_count = 0; /** @var DirectoryIterator $file */ foreach ( $files as $file ) { if ( 'po' !== $file->getExtension() ) { continue; } if ( ! $file->isFile() || ! $file->isReadable() ) { WP_CLI::warning( sprintf( 'Could not read file %s', $file->getFilename() ) ); continue; } $po_translations = Translations::fromPoFile( $file->getPathname() ); $po_translations->mergeWith( $pot_translations, Merge::ADD | Merge::REMOVE | Merge::COMMENTS_THEIRS | Merge::EXTRACTED_COMMENTS_THEIRS | Merge::REFERENCES_THEIRS | Merge::DOMAIN_OVERRIDE ); if ( ! $po_translations->toPoFile( $file->getPathname() ) ) { WP_CLI::warning( sprintf( 'Could not update file %s', $file->getPathname() ) ); continue; } ++$result_count; } WP_CLI::success( sprintf( 'Updated %d %s.', $result_count, Utils\pluralize( 'file', $result_count ) ) ); } }
Close