Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
presenters
/
File Content:
Inverter.php
<?php /** * Bundle inverter utility class. */ abstract class Loco_package_Inverter { /** * Get all Gettext files that are not configured and valid in the given bundle * @return array */ public static function export( Loco_package_Bundle $bundle ){ // search paths for inverted bundle will exclude global ignore paths, // plus anything known to the current configuration which we'll add now. $finder = $bundle->getFileFinder(); /* @var $project Loco_package_Project */ foreach( $bundle as $project ){ if( $file = $project->getPot() ){ // excluding all extensions in case POT is actually a PO/MO pair foreach( array('pot','po','mo') as $ext ){ $file = $file->cloneExtension($ext); if( $path = realpath( $file->getPath() ) ){ $finder->exclude( $path ); } } } foreach( $project->findLocaleFiles('po') as $file ){ if( $path = realpath( $file->getPath() ) ){ $finder->exclude( $path ); } } foreach( $project->findLocaleFiles('mo') as $file ){ if( $path = realpath( $file->getPath() ) ){ $finder->exclude( $path ); } } } // Do a deep scan of all files that haven't been seen, or been excluded: // This will include files in global directories and inside the bundle. return $finder->setRecursive(true)->followLinks(false)->group('po','mo','pot')->exportGroups(); } /** * Compile anything found under bundle root that isn't configured in $known * @return Loco_package_Bundle */ public static function compile( Loco_package_Bundle $bundle ){ $found = self::export($bundle); // done with original bundle now $bundle = clone $bundle; $bundle->clear(); // first iteration groups found files into common locations that should hopefully indicate translation sets $groups = array(); $templates = array(); $localised = array(); $root = $bundle->getDirectoryPath(); /* @var $list Loco_fs_FileList */ foreach( $found as $ext => $list ){ /* @var $file Loco_fs_LocaleFile */ foreach( $list as $file ){ // printf("Found: %s <br />\n", $file ); // This file is NOT known to be part of a configured project $dir = $file->getParent(); $key = $dir->getRelativePath( $root ); // if( ! isset($groups[$key]) ){ $groups[$key] = $dir; $templates[$key] = array(); $localised[$key] = array(); } // template should define single set of translations unique by directory and file prefix if( 'pot' === $ext ){ $slug = $file->filename(); $templates[$key][$slug] = true; } // else ideally PO/MO files will correspond to a template by common prefix else { $file = new Loco_fs_LocaleFile( $file ); $slug = $file->getPrefix(); if( $file->getLocale()->isValid() ){ $localised[$key][$slug] = true; } // else could be some kind of non-standard template else { $slug = $file->filename(); $templates[$key][$slug] = true; } } } } unset($found); // next iteration matches collected files together into likely project sets $unique = array(); /* @var $list Loco_fs_Directory */ foreach( $groups as $key => $dir ){ // pair up all projects that match templates neatly to prefixed files foreach( $templates[$key] as $slug => $bool ){ if( isset($localised[$key][$slug]) ){ //printf("Perfect match on domain '%s' in %s <br />\n", $slug, $key ); $unique[$key][$slug] = $dir; // done with this prefectly matched set $templates[$key][$slug] = null; $localised[$key][$slug] = null; } } // pair up any unprefixed localised files if( isset($localised[$key]['']) ){ $slug = 'unknown'; // Match to first (hopefully only) template to establish a slug foreach( $templates[$key] as $_slug => $bool ){ if( $bool ){ $slug = $_slug; $templates[$key][$slug] = null; break; // <- not possible to know how multiple POTs might be paired up } } //printf("Pairing unprefixed files in %s to '%s' <br />\n", $key, $slug ); $unique[$key][$slug] = $dir; // done with unprefixed localised files in this directory $localised[$key][''] = null; } // add any orphaned translations (those with no template matched) foreach( $localised[$key] as $slug => $bool ){ if( $bool ){ // printf("Picked up orphoned locales in %s as '%s' <br />\n", $key, $slug ); $unique[$key][$slug] = $dir; } } // add any orphaned templates (those with no localised files matched) foreach( $templates[$key] as $slug => $bool ){ if( $bool ){ //printf("Picked up orphoned template in %s as '%s' <br />\n", $key, $slug ); $unique[$key][$slug] = $dir; } } } unset( $groups, $localised, $templates ); // final iteration adds unique projects to bundle foreach( $unique as $key => $sets ){ foreach( $sets as $slug => $dir ){ $name = ucfirst( strtr( $slug, '-_', ' ' ) ); $domain = new Loco_package_TextDomain( $slug ); $project = $domain->createProject( $bundle, $name ); $project->addTargetDirectory($dir); $bundle->addProject($project); } // TODO how to prevent overlapping sets by adding each other's files to exclude lists } return $bundle; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
admin
---
0755
open-graph
---
0755
slack
---
0755
twitter
---
0755
webmaster
---
0755
-20260707073531.DS_Store
10234 bytes
0644
.DS_Store
10234 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController.php
945 bytes
0644
Inverter-20260707144656.php
6818 bytes
0644
Inverter.php
6818 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream-20260705123008.php
4209 bytes
0644
LimitStream.php
4209 bytes
0644
README.md
2555 bytes
0644
abstract-indexable-presenter.php
1020 bytes
0644
abstract-indexable-tag-presenter.php
1004 bytes
0644
abstract-presenter.php
377 bytes
0644
admin-network-it_IT.l10n.php
42133 bytes
0644
article-modified-time-presenter.php
609 bytes
0644
baidu-presenter.php
659 bytes
0644
bingbot-presenter.php
1674 bytes
0644
canonical-presenter.php
1066 bytes
0644
class-admin-utils-20260622095013.php
2147 bytes
0644
class-admin-utils.php
2147 bytes
0644
class-helpscout.php
6972 bytes
0644
class-metabox-formatter.php
12602 bytes
0644
class-opengraph-oembed.php
1126 bytes
0644
class-option-tab.php
1784 bytes
0644
class-option-tabs-formatter.php
2321 bytes
0644
class-sitemaps-admin-20260703023908-20260705035108.php
3665 bytes
0644
class-sitemaps-admin-20260703023908.php
3665 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-replacement-variable.php
1375 bytes
0644
class-wpseo-statistics-20260703220502.php
1443 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-network-admin.php
9688 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
class.constants-20260623122002.php
150 bytes
0644
class.pack.database-20260707021344.php
30838 bytes
0644
class.pack.database.php
30838 bytes
0644
dashboard-1650-rtl.css
1634 bytes
0644
define.php
4567 bytes
0644
description-presenter-20260623011438.php
1026 bytes
0644
duplicator-en_US.mo
582 bytes
0644
duplicator-main.php
26907 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin-20260706155921.php
3331 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260705194237.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623171315.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260624110936.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
environment-helper.php
596 bytes
0644
estimated-reading-time.php
1111 bytes
0644
exceptions.php
708 bytes
0644
flexible-widget.php
11167 bytes
0644
googlebot-presenter.php
1722 bytes
0644
help-link-presenter.php
2087 bytes
0644
image-helper.php
10231 bytes
0644
image-presenter.php
2093 bytes
0644
inc.data-20260705181931.php
5121 bytes
0644
inc.data.php
5121 bytes
0644
inc.validator.php
5401 bytes
0644
index.php
157663 bytes
0644
interface-sitemap-cache-data.php
1208 bytes
0644
light-switch-presenter.php
4586 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager.php
14659 bytes
0644
meta-description-presenter.php
1941 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module.php
1297 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
recovery.php
1146 bytes
0644
rel-next-presenter.php
1581 bytes
0644
rel-prev-presenter.php
1561 bytes
0644
robots-presenter-20260623011214.php
630 bytes
0644
root.php
1951 bytes
0644
schema-presenter-20260623011450.php
1358 bytes
0644
social.php
725 bytes
0644
title-presenter.php
1393 bytes
0644
url-list-presenter.php
983 bytes
0644
wordpress-seo-es_ES-20260704221345.json
25583 bytes
0644
wordpress-seo-es_ES.json
25583 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-bs_BA-20260704174856.json
13790 bytes
0644
wordpress-seojs-bs_BA.json
13790 bytes
0644
wordpress-seojs-es_ES.json
20568 bytes
0644
wordpress-seojs-fi.json
19387 bytes
0644
wordpress-seojs-gl_ES.json
20143 bytes
0644
wordpress-seojs-ja-20260707075320.json
21424 bytes
0644
wordpress-seojs-ja.json
21424 bytes
0644
wordpress-seojs-uk.json
26506 bytes
0644
wp-query-wrapper.php
834 bytes
0644
N4ST4R_ID | Naxtarrr