Cyr-To-Lat - Version 5.1.0

Version Description

(19.07.2021) = * Fix issue-95 - 404 on localized terms created before plugin install. * Add cache flushing after batch conversion. * Tested with WordPress 5.8

Download this release

Release Info

Developer mihdan
Plugin Icon 128x128 Cyr-To-Lat
Version 5.1.0
Comparing to
See all releases

Code changes from version 5.0.4 to 5.1.0

Files changed (114) hide show
  1. auth.json +5 -0
  2. cyr-to-lat.php +2 -2
  3. readme.txt +17 -2
  4. src/php/background-processes/class-post-conversion-process.php +2 -0
  5. src/php/background-processes/class-term-conversion-process.php +2 -0
  6. src/php/class-conversion-tables.php +1 -0
  7. src/php/class-main.php +39 -47
  8. vendor/autoload.php +1 -1
  9. vendor/composer/ClassLoader.php +3 -1
  10. vendor/composer/InstalledVersions.php +326 -295
  11. vendor/composer/autoload_psr4.php +0 -1
  12. vendor/composer/autoload_real.php +7 -7
  13. vendor/composer/autoload_static.php +2 -18
  14. vendor/composer/installed.json +1 -146
  15. vendor/composer/installed.php +20 -44
  16. vendor/composer/installers/LICENSE +0 -19
  17. vendor/composer/installers/composer.json +0 -112
  18. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +0 -21
  19. vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +0 -9
  20. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +0 -11
  21. vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +0 -49
  22. vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +0 -9
  23. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +0 -137
  24. vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +0 -126
  25. vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +0 -9
  26. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +0 -72
  27. vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +0 -11
  28. vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php +0 -9
  29. vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +0 -10
  30. vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +0 -34
  31. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +0 -11
  32. vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +0 -13
  33. vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +0 -35
  34. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +0 -21
  35. vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +0 -10
  36. vendor/composer/installers/src/Composer/Installers/DframeInstaller.php +0 -10
  37. vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +0 -50
  38. vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +0 -16
  39. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +0 -22
  40. vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +0 -9
  41. vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +0 -12
  42. vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +0 -29
  43. vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +0 -10
  44. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +0 -11
  45. vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +0 -9
  46. vendor/composer/installers/src/Composer/Installers/GravInstaller.php +0 -30
  47. vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +0 -25
  48. vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +0 -11
  49. vendor/composer/installers/src/Composer/Installers/Installer.php +0 -280
  50. vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +0 -9
  51. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +0 -15
  52. vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +0 -18
  53. vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +0 -11
  54. vendor/composer/installers/src/Composer/Installers/KnownInstaller.php +0 -11
  55. vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +0 -10
  56. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +0 -9
  57. vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +0 -27
  58. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +0 -9
  59. vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +0 -10
  60. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +0 -10
  61. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +0 -9
  62. vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +0 -16
  63. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +0 -11
  64. vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +0 -37
  65. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +0 -9
  66. vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php +0 -23
  67. vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +0 -25
  68. vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +0 -33
  69. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +0 -51
  70. vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +0 -119
  71. vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +0 -12
  72. vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +0 -58
  73. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +0 -47
  74. vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +0 -24
  75. vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +0 -14
  76. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +0 -59
  77. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +0 -9
  78. vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +0 -11
  79. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +0 -11
  80. vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +0 -21
  81. vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +0 -32
  82. vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +0 -29
  83. vendor/composer/installers/src/Composer/Installers/Plugin.php +0 -27
  84. vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +0 -9
  85. vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +0 -10
  86. vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +0 -11
  87. vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +0 -63
  88. vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +0 -24
  89. vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +0 -10
  90. vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php +0 -10
  91. vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +0 -10
  92. vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +0 -22
  93. vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +0 -10
  94. vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +0 -60
  95. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +0 -35
  96. vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +0 -25
  97. vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +0 -49
  98. vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php +0 -9
  99. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +0 -26
  100. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +0 -16
  101. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +0 -38
  102. vendor/composer/installers/src/Composer/Installers/TaoInstaller.php +0 -12
  103. vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +0 -12
  104. vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +0 -14
  105. vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +0 -9
  106. vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +0 -10
  107. vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +0 -49
  108. vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +0 -21
  109. vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +0 -9
  110. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +0 -12
  111. vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +0 -32
  112. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +0 -11
  113. vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +0 -10
  114. vendor/composer/installers/src/bootstrap.php +0 -13
auth.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ {
2
+ "github-oauth": {
3
+ "github.com": "ghs_fjJ8J8shkWRKMd6pm8bUJi2ZxwauIV0GIY98"
4
+ }
5
+ }
cyr-to-lat.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: Cyr-To-Lat
11
  * Plugin URI: https://wordpress.org/plugins/cyr2lat/
12
  * Description: Convert Non-Latin characters in post and term slugs to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
13
- * Version: 5.0.4
14
  * Requires at least: 5.1
15
  * Requires PHP: 5.6.20
16
  * Author: Sergey Biryukov, Mikhail Kobzarev, Igor Gergel
@@ -36,7 +36,7 @@ if ( defined( 'CYR_TO_LAT_VERSION' ) ) {
36
  /**
37
  * Plugin version.
38
  */
39
- define( 'CYR_TO_LAT_VERSION', '5.0.4' );
40
 
41
  /**
42
  * Path to the plugin dir.
10
  * Plugin Name: Cyr-To-Lat
11
  * Plugin URI: https://wordpress.org/plugins/cyr2lat/
12
  * Description: Convert Non-Latin characters in post and term slugs to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
13
+ * Version: 5.1.0
14
  * Requires at least: 5.1
15
  * Requires PHP: 5.6.20
16
  * Author: Sergey Biryukov, Mikhail Kobzarev, Igor Gergel
36
  /**
37
  * Plugin version.
38
  */
39
+ define( 'CYR_TO_LAT_VERSION', '5.1.0' );
40
 
41
  /**
42
  * Path to the plugin dir.
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: SergeyBiryukov, mihdan, karevn, webvitaly, kaggdesign
3
  Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
4
  Requires at least: 5.1
5
- Tested up to: 5.7
6
- Stable tag: 5.0.4
7
  Requires PHP: 5.6.20
8
 
9
  Convert Non-Latin characters in post, page and term slugs to Latin characters.
@@ -169,6 +169,16 @@ Where
169
  `-post_type` is list of post types,
170
  `-post_status` is list of post statuses.
171
 
 
 
 
 
 
 
 
 
 
 
172
  = Can I contribute? =
173
 
174
  Yes you can!
@@ -178,6 +188,11 @@ Yes you can!
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
181
  = 5.0.4 (17.04.2021) =
182
  * Fix bug in converter without saved options
183
 
2
  Contributors: SergeyBiryukov, mihdan, karevn, webvitaly, kaggdesign
3
  Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
4
  Requires at least: 5.1
5
+ Tested up to: 5.8
6
+ Stable tag: 5.1.0
7
  Requires PHP: 5.6.20
8
 
9
  Convert Non-Latin characters in post, page and term slugs to Latin characters.
169
  `-post_type` is list of post types,
170
  `-post_status` is list of post statuses.
171
 
172
+ = How can I regenerate thumbnails safely? =
173
+
174
+ Regeneration of thumbnails with the command `wp media regenerate` can break links in old posts as file names become transliterated.
175
+
176
+ To avoid it, deactivate cyr2lat plugin during regeneration:
177
+
178
+ `
179
+ wp media regenerate --skip-plugins=cyr2lat
180
+ `
181
+
182
  = Can I contribute? =
183
 
184
  Yes you can!
188
 
189
  == Changelog ==
190
 
191
+ = 5.1.0 (19.07.2021) =
192
+ * Fix issue-95 - 404 on localized terms created before plugin install.
193
+ * Add cache flushing after batch conversion.
194
+ * Tested with WordPress 5.8
195
+
196
  = 5.0.4 (17.04.2021) =
197
  * Fix bug in converter without saved options
198
 
src/php/background-processes/class-post-conversion-process.php CHANGED
@@ -195,6 +195,8 @@ class Post_Conversion_Process extends Conversion_Process {
195
  protected function complete() {
196
  parent::complete();
197
 
 
 
198
  $this->log( __( 'Post slugs conversion completed.', 'cyr2lat' ) );
199
  }
200
 
195
  protected function complete() {
196
  parent::complete();
197
 
198
+ wp_cache_flush();
199
+
200
  $this->log( __( 'Post slugs conversion completed.', 'cyr2lat' ) );
201
  }
202
 
src/php/background-processes/class-term-conversion-process.php CHANGED
@@ -81,6 +81,8 @@ class Term_Conversion_Process extends Conversion_Process {
81
  protected function complete() {
82
  parent::complete();
83
 
 
 
84
  $this->log( __( 'Term slugs conversion completed.', 'cyr2lat' ) );
85
  }
86
 
81
  protected function complete() {
82
  parent::complete();
83
 
84
+ wp_cache_flush();
85
+
86
  $this->log( __( 'Term slugs conversion completed.', 'cyr2lat' ) );
87
  }
88
 
src/php/class-conversion-tables.php CHANGED
@@ -168,6 +168,7 @@ class Conversion_Tables {
168
  ];
169
  break;
170
  // Bulgarian.
 
171
  case 'bg_BG':
172
  $table = [
173
  'А' => 'A',
168
  ];
169
  break;
170
  // Bulgarian.
171
+ // @link https://ru.wikipedia.org/wiki/ISO_9#%D0%A2%D0%B0%D0%B1%D0%BB._2._%D0%A2%D1%80%D0%B0%D0%BD%D1%81%D0%BB%D0%B8%D1%82%D0%B5%D1%80%D0%B0%D1%86%D0%B8%D1%8F_%D0%BF%D0%BE_%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B5_%D0%91.
172
  case 'bg_BG':
173
  $table = [
174
  'А' => 'A',
src/php/class-main.php CHANGED
@@ -72,18 +72,18 @@ class Main {
72
  protected $acf;
73
 
74
  /**
75
- * Term saved in pre_insert_term filter.
76
  *
77
- * @var string|WP_Error|null
78
  */
79
- private $term;
80
 
81
  /**
82
- * Taxonomy saved in pre_insert_term filter.
83
  *
84
- * @var string|null
85
  */
86
- private $taxonomy;
87
 
88
  /**
89
  * Polylang locale.
@@ -125,7 +125,6 @@ class Main {
125
  * Init class.
126
  *
127
  * @noinspection PhpUndefinedClassInspection
128
- * @noinspection PhpUnusedLocalVariableInspection
129
  */
130
  public function init() {
131
  if ( defined( 'WP_CLI' ) && constant( 'WP_CLI' ) ) {
@@ -151,7 +150,8 @@ class Main {
151
  add_filter( 'sanitize_title', [ $this, 'sanitize_title' ], 9, 3 );
152
  add_filter( 'sanitize_file_name', [ $this, 'sanitize_filename' ], 10, 2 );
153
  add_filter( 'wp_insert_post_data', [ $this, 'sanitize_post_name' ], 10, 2 );
154
- add_filter( 'pre_insert_term', [ $this, 'pre_term_filter' ], PHP_INT_MAX, 2 );
 
155
 
156
  if ( class_exists( 'Polylang' ) ) {
157
  add_filter( 'locale', [ $this, 'pll_locale_filter' ] );
@@ -187,34 +187,23 @@ class Main {
187
  return $pre;
188
  }
189
 
190
- $is_term = false;
191
- // phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
192
- $backtrace = debug_backtrace( ~DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS );
193
- // phpcs:enable
194
- foreach ( $backtrace as $backtrace_entry ) {
195
- if ( 'wp_insert_term' === $backtrace_entry['function'] ) {
196
- $is_term = true;
197
- break;
198
- }
199
- }
200
-
201
  $term = '';
202
- if ( $is_term && null !== $this->term && null !== $this->taxonomy ) {
203
- // phpcs:disable WordPress.DB.DirectDatabaseQuery
204
- $term = $wpdb->get_var(
205
- $wpdb->prepare(
206
- "SELECT slug FROM $wpdb->terms t LEFT JOIN $wpdb->term_taxonomy tt
207
  ON t.term_id = tt.term_id
208
- WHERE t.name = %s AND tt.taxonomy = %s",
209
- $title,
210
- $this->taxonomy
211
- )
212
  );
213
- // phpcs:enable
 
 
 
 
 
214
 
215
  // Make sure we search in the db only once being called from wp_insert_term().
216
- $this->term = null;
217
- $this->taxonomy = null;
218
  }
219
 
220
  if ( ! empty( $term ) ) {
@@ -268,7 +257,7 @@ class Main {
268
  }
269
 
270
  if ( seems_utf8( $filename ) ) {
271
- $filename = mb_strtolower( $filename );
272
  }
273
 
274
  return $this->transliterate( $filename );
@@ -343,15 +332,8 @@ class Main {
343
 
344
  $string = $this->fix_mac_string( $string );
345
  $string = $this->split_chinese_string( $string, $table );
346
- $string = strtr( $string, $table );
347
 
348
- if ( function_exists( 'iconv' ) ) {
349
- $new_string = iconv( 'UTF-8', 'UTF-8//TRANSLIT//IGNORE', $string );
350
-
351
- return $new_string ?: $string;
352
- }
353
-
354
- return $string;
355
  }
356
 
357
  /**
@@ -439,12 +421,9 @@ class Main {
439
  * @param string|int|WP_Error $term The term name to add, or a WP_Error object if there's an error.
440
  * @param string $taxonomy Taxonomy slug.
441
  *
442
- * @return mixed
443
  */
444
- public function pre_term_filter( $term, $taxonomy ) {
445
- $this->term = null;
446
- $this->taxonomy = null;
447
-
448
  if (
449
  0 === $term ||
450
  '' === trim( $term ) ||
@@ -453,12 +432,25 @@ class Main {
453
  return $term;
454
  }
455
 
456
- $this->term = $term;
457
- $this->taxonomy = $taxonomy;
458
 
459
  return $term;
460
  }
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  /**
463
  * Locale filter for Polylang.
464
  *
72
  protected $acf;
73
 
74
  /**
75
+ * Flag showing that we are processing a term.
76
  *
77
+ * @var bool
78
  */
79
+ private $is_term = false;
80
 
81
  /**
82
+ * Taxonomies saved in pre_insert_term or get_terms_args filter.
83
  *
84
+ * @var string[]|null
85
  */
86
+ private $taxonomies;
87
 
88
  /**
89
  * Polylang locale.
125
  * Init class.
126
  *
127
  * @noinspection PhpUndefinedClassInspection
 
128
  */
129
  public function init() {
130
  if ( defined( 'WP_CLI' ) && constant( 'WP_CLI' ) ) {
150
  add_filter( 'sanitize_title', [ $this, 'sanitize_title' ], 9, 3 );
151
  add_filter( 'sanitize_file_name', [ $this, 'sanitize_filename' ], 10, 2 );
152
  add_filter( 'wp_insert_post_data', [ $this, 'sanitize_post_name' ], 10, 2 );
153
+ add_filter( 'pre_insert_term', [ $this, 'pre_insert_term_filter' ], PHP_INT_MAX, 2 );
154
+ add_filter( 'get_terms_args', [ $this, 'get_terms_args_filter' ], PHP_INT_MAX, 2 );
155
 
156
  if ( class_exists( 'Polylang' ) ) {
157
  add_filter( 'locale', [ $this, 'pll_locale_filter' ] );
187
  return $pre;
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
 
190
  $term = '';
191
+ if ( $this->is_term ) {
192
+ $sql = $wpdb->prepare(
193
+ "SELECT slug FROM $wpdb->terms t LEFT JOIN $wpdb->term_taxonomy tt
 
 
194
  ON t.term_id = tt.term_id
195
+ WHERE t.name = %s",
196
+ $title
 
 
197
  );
198
+ $sql .= ' AND tt.taxonomy IN (' . $this->prepare_in( $this->taxonomies ) . ')';
199
+
200
+ // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
201
+ // phpcs:ignore WordPress.DB.DirectDatabaseQuery
202
+ $term = $wpdb->get_var( $sql );
203
+ // phpcs:enable WordPress.DB.PreparedSQL.NotPrepared
204
 
205
  // Make sure we search in the db only once being called from wp_insert_term().
206
+ $this->is_term = false;
 
207
  }
208
 
209
  if ( ! empty( $term ) ) {
257
  }
258
 
259
  if ( seems_utf8( $filename ) ) {
260
+ $filename = (string) Mbstring::mb_strtolower( $filename );
261
  }
262
 
263
  return $this->transliterate( $filename );
332
 
333
  $string = $this->fix_mac_string( $string );
334
  $string = $this->split_chinese_string( $string, $table );
 
335
 
336
+ return strtr( $string, $table );
 
 
 
 
 
 
337
  }
338
 
339
  /**
421
  * @param string|int|WP_Error $term The term name to add, or a WP_Error object if there's an error.
422
  * @param string $taxonomy Taxonomy slug.
423
  *
424
+ * @return string|int
425
  */
426
+ public function pre_insert_term_filter( $term, $taxonomy ) {
 
 
 
427
  if (
428
  0 === $term ||
429
  '' === trim( $term ) ||
432
  return $term;
433
  }
434
 
435
+ $this->is_term = true;
436
+ $this->taxonomies = [ $taxonomy ];
437
 
438
  return $term;
439
  }
440
 
441
+ /**
442
+ * Filters the terms query arguments.
443
+ *
444
+ * @param array $args An array of get_terms() arguments.
445
+ * @param string[] $taxonomies An array of taxonomy names.
446
+ */
447
+ public function get_terms_args_filter( $args, $taxonomies ) {
448
+ $this->is_term = true;
449
+ $this->taxonomies = $taxonomies;
450
+
451
+ return $args;
452
+ }
453
+
454
  /**
455
  * Locale filter for Polylang.
456
  *
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit0c6bffce0ae3be551c79741eef762d0b::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitbbd01d49cde47496e63566fafeb98b8f::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -338,7 +338,7 @@ class ClassLoader
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
- * @return bool|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
@@ -347,6 +347,8 @@ class ClassLoader
347
 
348
  return true;
349
  }
 
 
350
  }
351
 
352
  /**
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
+ * @return true|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
347
 
348
  return true;
349
  }
350
+
351
+ return null;
352
  }
353
 
354
  /**
vendor/composer/InstalledVersions.php CHANGED
@@ -1,306 +1,337 @@
1
  <?php
2
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
-
19
-
20
-
21
-
22
-
 
 
23
  class InstalledVersions
24
  {
25
- private static $installed = array (
26
- 'root' =>
27
- array (
28
- 'pretty_version' => '5.0.4',
29
- 'version' => '5.0.4.0',
30
- 'aliases' =>
31
- array (
32
- ),
33
- 'reference' => 'b8b728c89d6ca99f07f0f3d2777adcd46a6f629a',
34
- 'name' => 'mihdan/cyr2lat',
35
- ),
36
- 'versions' =>
37
- array (
38
- 'composer/installers' =>
39
- array (
40
- 'pretty_version' => 'v1.9.0',
41
- 'version' => '1.9.0.0',
42
- 'aliases' =>
43
- array (
44
- ),
45
- 'reference' => 'b93bcf0fa1fccb0b7d176b0967d969691cd74cca',
46
- ),
47
- 'mihdan/cyr2lat' =>
48
- array (
49
- 'pretty_version' => '5.0.4',
50
- 'version' => '5.0.4.0',
51
- 'aliases' =>
52
- array (
53
- ),
54
- 'reference' => 'b8b728c89d6ca99f07f0f3d2777adcd46a6f629a',
55
- ),
56
- 'roundcube/plugin-installer' =>
57
- array (
58
- 'replaced' =>
59
- array (
60
- 0 => '*',
61
- ),
62
- ),
63
- 'shama/baton' =>
64
- array (
65
- 'replaced' =>
66
- array (
67
- 0 => '*',
68
- ),
69
- ),
70
- ),
71
- );
72
- private static $canGetVendors;
73
- private static $installedByVendor = array();
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- public static function getInstalledPackages()
82
- {
83
- $packages = array();
84
- foreach (self::getInstalled() as $installed) {
85
- $packages[] = array_keys($installed['versions']);
86
- }
87
-
88
-
89
- if (1 === \count($packages)) {
90
- return $packages[0];
91
- }
92
-
93
- return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
94
- }
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
- public static function isInstalled($packageName)
105
- {
106
- foreach (self::getInstalled() as $installed) {
107
- if (isset($installed['versions'][$packageName])) {
108
- return true;
109
- }
110
- }
111
-
112
- return false;
113
- }
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
- public static function satisfies(VersionParser $parser, $packageName, $constraint)
129
- {
130
- $constraint = $parser->parseConstraints($constraint);
131
- $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
132
-
133
- return $provided->matches($constraint);
134
- }
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
- public static function getVersionRanges($packageName)
146
- {
147
- foreach (self::getInstalled() as $installed) {
148
- if (!isset($installed['versions'][$packageName])) {
149
- continue;
150
- }
151
-
152
- $ranges = array();
153
- if (isset($installed['versions'][$packageName]['pretty_version'])) {
154
- $ranges[] = $installed['versions'][$packageName]['pretty_version'];
155
- }
156
- if (array_key_exists('aliases', $installed['versions'][$packageName])) {
157
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
158
- }
159
- if (array_key_exists('replaced', $installed['versions'][$packageName])) {
160
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
161
- }
162
- if (array_key_exists('provided', $installed['versions'][$packageName])) {
163
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
164
- }
165
-
166
- return implode(' || ', $ranges);
167
- }
168
-
169
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
170
- }
171
-
172
-
173
-
174
-
175
-
176
- public static function getVersion($packageName)
177
- {
178
- foreach (self::getInstalled() as $installed) {
179
- if (!isset($installed['versions'][$packageName])) {
180
- continue;
181
- }
182
-
183
- if (!isset($installed['versions'][$packageName]['version'])) {
184
- return null;
185
- }
186
-
187
- return $installed['versions'][$packageName]['version'];
188
- }
189
-
190
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
191
- }
192
-
193
-
194
-
195
-
196
-
197
- public static function getPrettyVersion($packageName)
198
- {
199
- foreach (self::getInstalled() as $installed) {
200
- if (!isset($installed['versions'][$packageName])) {
201
- continue;
202
- }
203
-
204
- if (!isset($installed['versions'][$packageName]['pretty_version'])) {
205
- return null;
206
- }
207
-
208
- return $installed['versions'][$packageName]['pretty_version'];
209
- }
210
-
211
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
212
- }
213
-
214
-
215
-
216
-
217
-
218
- public static function getReference($packageName)
219
- {
220
- foreach (self::getInstalled() as $installed) {
221
- if (!isset($installed['versions'][$packageName])) {
222
- continue;
223
- }
224
-
225
- if (!isset($installed['versions'][$packageName]['reference'])) {
226
- return null;
227
- }
228
-
229
- return $installed['versions'][$packageName]['reference'];
230
- }
231
-
232
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
233
- }
234
-
235
-
236
-
237
-
238
-
239
- public static function getRootPackage()
240
- {
241
- $installed = self::getInstalled();
242
-
243
- return $installed[0]['root'];
244
- }
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
- public static function getRawData()
253
- {
254
- return self::$installed;
255
- }
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
- public static function reload($data)
276
- {
277
- self::$installed = $data;
278
- self::$installedByVendor = array();
279
- }
280
-
281
-
282
-
283
-
284
- private static function getInstalled()
285
- {
286
- if (null === self::$canGetVendors) {
287
- self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
288
- }
289
-
290
- $installed = array();
291
-
292
- if (self::$canGetVendors) {
293
- foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
294
- if (isset(self::$installedByVendor[$vendorDir])) {
295
- $installed[] = self::$installedByVendor[$vendorDir];
296
- } elseif (is_file($vendorDir.'/composer/installed.php')) {
297
- $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
298
- }
299
- }
300
- }
301
-
302
- $installed[] = self::$installed;
303
-
304
- return $installed;
305
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  }
1
  <?php
2
 
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
+ /**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require it's presence, you can require `composer-runtime-api ^2.0`
24
+ */
25
  class InstalledVersions
26
  {
27
+ private static $installed;
28
+ private static $canGetVendors;
29
+ private static $installedByVendor = array();
30
+
31
+ /**
32
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
33
+ *
34
+ * @return string[]
35
+ * @psalm-return list<string>
36
+ */
37
+ public static function getInstalledPackages()
38
+ {
39
+ $packages = array();
40
+ foreach (self::getInstalled() as $installed) {
41
+ $packages[] = array_keys($installed['versions']);
42
+ }
43
+
44
+ if (1 === \count($packages)) {
45
+ return $packages[0];
46
+ }
47
+
48
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
49
+ }
50
+
51
+ /**
52
+ * Returns a list of all package names with a specific type e.g. 'library'
53
+ *
54
+ * @param string $type
55
+ * @return string[]
56
+ * @psalm-return list<string>
57
+ */
58
+ public static function getInstalledPackagesByType($type)
59
+ {
60
+ $packagesByType = array();
61
+
62
+ foreach (self::getInstalled() as $installed) {
63
+ foreach ($installed['versions'] as $name => $package) {
64
+ if (isset($package['type']) && $package['type'] === $type) {
65
+ $packagesByType[] = $name;
66
+ }
67
+ }
68
+ }
69
+
70
+ return $packagesByType;
71
+ }
72
+
73
+ /**
74
+ * Checks whether the given package is installed
75
+ *
76
+ * This also returns true if the package name is provided or replaced by another package
77
+ *
78
+ * @param string $packageName
79
+ * @param bool $includeDevRequirements
80
+ * @return bool
81
+ */
82
+ public static function isInstalled($packageName, $includeDevRequirements = true)
83
+ {
84
+ foreach (self::getInstalled() as $installed) {
85
+ if (isset($installed['versions'][$packageName])) {
86
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
87
+ }
88
+ }
89
+
90
+ return false;
91
+ }
92
+
93
+ /**
94
+ * Checks whether the given package satisfies a version constraint
95
+ *
96
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
97
+ *
98
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
99
+ *
100
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
101
+ * @param string $packageName
102
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
103
+ * @return bool
104
+ */
105
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
106
+ {
107
+ $constraint = $parser->parseConstraints($constraint);
108
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
109
+
110
+ return $provided->matches($constraint);
111
+ }
112
+
113
+ /**
114
+ * Returns a version constraint representing all the range(s) which are installed for a given package
115
+ *
116
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
117
+ * whether a given version of a package is installed, and not just whether it exists
118
+ *
119
+ * @param string $packageName
120
+ * @return string Version constraint usable with composer/semver
121
+ */
122
+ public static function getVersionRanges($packageName)
123
+ {
124
+ foreach (self::getInstalled() as $installed) {
125
+ if (!isset($installed['versions'][$packageName])) {
126
+ continue;
127
+ }
128
+
129
+ $ranges = array();
130
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
131
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
132
+ }
133
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
134
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
135
+ }
136
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
137
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
138
+ }
139
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
140
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
141
+ }
142
+
143
+ return implode(' || ', $ranges);
144
+ }
145
+
146
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
147
+ }
148
+
149
+ /**
150
+ * @param string $packageName
151
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
152
+ */
153
+ public static function getVersion($packageName)
154
+ {
155
+ foreach (self::getInstalled() as $installed) {
156
+ if (!isset($installed['versions'][$packageName])) {
157
+ continue;
158
+ }
159
+
160
+ if (!isset($installed['versions'][$packageName]['version'])) {
161
+ return null;
162
+ }
163
+
164
+ return $installed['versions'][$packageName]['version'];
165
+ }
166
+
167
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
168
+ }
169
+
170
+ /**
171
+ * @param string $packageName
172
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
173
+ */
174
+ public static function getPrettyVersion($packageName)
175
+ {
176
+ foreach (self::getInstalled() as $installed) {
177
+ if (!isset($installed['versions'][$packageName])) {
178
+ continue;
179
+ }
180
+
181
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
182
+ return null;
183
+ }
184
+
185
+ return $installed['versions'][$packageName]['pretty_version'];
186
+ }
187
+
188
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
189
+ }
190
+
191
+ /**
192
+ * @param string $packageName
193
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
194
+ */
195
+ public static function getReference($packageName)
196
+ {
197
+ foreach (self::getInstalled() as $installed) {
198
+ if (!isset($installed['versions'][$packageName])) {
199
+ continue;
200
+ }
201
+
202
+ if (!isset($installed['versions'][$packageName]['reference'])) {
203
+ return null;
204
+ }
205
+
206
+ return $installed['versions'][$packageName]['reference'];
207
+ }
208
+
209
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
210
+ }
211
+
212
+ /**
213
+ * @param string $packageName
214
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
215
+ */
216
+ public static function getInstallPath($packageName)
217
+ {
218
+ foreach (self::getInstalled() as $installed) {
219
+ if (!isset($installed['versions'][$packageName])) {
220
+ continue;
221
+ }
222
+
223
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
224
+ }
225
+
226
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
227
+ }
228
+
229
+ /**
230
+ * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
+ */
233
+ public static function getRootPackage()
234
+ {
235
+ $installed = self::getInstalled();
236
+
237
+ return $installed[0]['root'];
238
+ }
239
+
240
+ /**
241
+ * Returns the raw installed.php data for custom implementations
242
+ *
243
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
+ * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
+ */
247
+ public static function getRawData()
248
+ {
249
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
250
+
251
+ if (null === self::$installed) {
252
+ // only require the installed.php file if this file is loaded from its dumped location,
253
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
254
+ if (substr(__DIR__, -8, 1) !== 'C') {
255
+ self::$installed = include __DIR__ . '/installed.php';
256
+ } else {
257
+ self::$installed = array();
258
+ }
259
+ }
260
+
261
+ return self::$installed;
262
+ }
263
+
264
+ /**
265
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
+ *
267
+ * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
+ */
270
+ public static function getAllRawData()
271
+ {
272
+ return self::getInstalled();
273
+ }
274
+
275
+ /**
276
+ * Lets you reload the static array from another file
277
+ *
278
+ * This is only useful for complex integrations in which a project needs to use
279
+ * this class but then also needs to execute another project's autoloader in process,
280
+ * and wants to ensure both projects have access to their version of installed.php.
281
+ *
282
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
283
+ * the data it needs from this class, then call reload() with
284
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
285
+ * the project in which it runs can then also use this class safely, without
286
+ * interference between PHPUnit's dependencies and the project's dependencies.
287
+ *
288
+ * @param array[] $data A vendor/composer/installed.php data set
289
+ * @return void
290
+ *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
+ */
293
+ public static function reload($data)
294
+ {
295
+ self::$installed = $data;
296
+ self::$installedByVendor = array();
297
+ }
298
+
299
+ /**
300
+ * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
+ */
303
+ private static function getInstalled()
304
+ {
305
+ if (null === self::$canGetVendors) {
306
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
307
+ }
308
+
309
+ $installed = array();
310
+
311
+ if (self::$canGetVendors) {
312
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
313
+ if (isset(self::$installedByVendor[$vendorDir])) {
314
+ $installed[] = self::$installedByVendor[$vendorDir];
315
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
316
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
317
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
318
+ self::$installed = $installed[count($installed) - 1];
319
+ }
320
+ }
321
+ }
322
+ }
323
+
324
+ if (null === self::$installed) {
325
+ // only require the installed.php file if this file is loaded from its dumped location,
326
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
327
+ if (substr(__DIR__, -8, 1) !== 'C') {
328
+ self::$installed = require __DIR__ . '/installed.php';
329
+ } else {
330
+ self::$installed = array();
331
+ }
332
+ }
333
+ $installed[] = self::$installed;
334
+
335
+ return $installed;
336
+ }
337
  }
vendor/composer/autoload_psr4.php CHANGED
@@ -6,5 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
10
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit0c6bffce0ae3be551c79741eef762d0b
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit0c6bffce0ae3be551c79741eef762d0b
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit0c6bffce0ae3be551c79741eef762d0b', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInit0c6bffce0ae3be551c79741eef762d0b', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit0c6bffce0ae3be551c79741eef762d0b
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire0c6bffce0ae3be551c79741eef762d0b($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire0c6bffce0ae3be551c79741eef762d0b($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitbbd01d49cde47496e63566fafeb98b8f
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitbbd01d49cde47496e63566fafeb98b8f', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitbbd01d49cde47496e63566fafeb98b8f', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInitbbd01d49cde47496e63566fafeb98b8f::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInitbbd01d49cde47496e63566fafeb98b8f::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequirebbd01d49cde47496e63566fafeb98b8f($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequirebbd01d49cde47496e63566fafeb98b8f($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,26 +4,12 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b
8
  {
9
  public static $files = array (
10
  '344a0f93a05b8ca362c22e39586db500' => __DIR__ . '/../..' . '/lib/polyfill-mbstring/bootstrap.php',
11
  );
12
 
13
- public static $prefixLengthsPsr4 = array (
14
- 'C' =>
15
- array (
16
- 'Composer\\Installers\\' => 20,
17
- ),
18
- );
19
-
20
- public static $prefixDirsPsr4 = array (
21
- 'Composer\\Installers\\' =>
22
- array (
23
- 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
24
- ),
25
- );
26
-
27
  public static $classMap = array (
28
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
29
  'Cyr_To_Lat\\ACF' => __DIR__ . '/../..' . '/src/php/class-acf.php',
@@ -50,9 +36,7 @@ class ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b
50
  public static function getInitializer(ClassLoader $loader)
51
  {
52
  return \Closure::bind(function () use ($loader) {
53
- $loader->prefixLengthsPsr4 = ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b::$prefixLengthsPsr4;
54
- $loader->prefixDirsPsr4 = ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b::$prefixDirsPsr4;
55
- $loader->classMap = ComposerStaticInit0c6bffce0ae3be551c79741eef762d0b::$classMap;
56
 
57
  }, null, ClassLoader::class);
58
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitbbd01d49cde47496e63566fafeb98b8f
8
  {
9
  public static $files = array (
10
  '344a0f93a05b8ca362c22e39586db500' => __DIR__ . '/../..' . '/lib/polyfill-mbstring/bootstrap.php',
11
  );
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  public static $classMap = array (
14
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
15
  'Cyr_To_Lat\\ACF' => __DIR__ . '/../..' . '/src/php/class-acf.php',
36
  public static function getInitializer(ClassLoader $loader)
37
  {
38
  return \Closure::bind(function () use ($loader) {
39
+ $loader->classMap = ComposerStaticInitbbd01d49cde47496e63566fafeb98b8f::$classMap;
 
 
40
 
41
  }, null, ClassLoader::class);
42
  }
vendor/composer/installed.json CHANGED
@@ -1,150 +1,5 @@
1
  {
2
- "packages": [
3
- {
4
- "name": "composer/installers",
5
- "version": "v1.9.0",
6
- "version_normalized": "1.9.0.0",
7
- "source": {
8
- "type": "git",
9
- "url": "https://github.com/composer/installers.git",
10
- "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca"
11
- },
12
- "dist": {
13
- "type": "zip",
14
- "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca",
15
- "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca",
16
- "shasum": ""
17
- },
18
- "require": {
19
- "composer-plugin-api": "^1.0 || ^2.0"
20
- },
21
- "replace": {
22
- "roundcube/plugin-installer": "*",
23
- "shama/baton": "*"
24
- },
25
- "require-dev": {
26
- "composer/composer": "1.6.* || 2.0.*@dev",
27
- "composer/semver": "1.0.* || 2.0.*@dev",
28
- "phpunit/phpunit": "^4.8.36",
29
- "sebastian/comparator": "^1.2.4",
30
- "symfony/process": "^2.3"
31
- },
32
- "time": "2020-04-07T06:57:05+00:00",
33
- "type": "composer-plugin",
34
- "extra": {
35
- "class": "Composer\\Installers\\Plugin",
36
- "branch-alias": {
37
- "dev-master": "1.0-dev"
38
- }
39
- },
40
- "installation-source": "dist",
41
- "autoload": {
42
- "psr-4": {
43
- "Composer\\Installers\\": "src/Composer/Installers"
44
- }
45
- },
46
- "notification-url": "https://packagist.org/downloads/",
47
- "license": [
48
- "MIT"
49
- ],
50
- "authors": [
51
- {
52
- "name": "Kyle Robinson Young",
53
- "email": "kyle@dontkry.com",
54
- "homepage": "https://github.com/shama"
55
- }
56
- ],
57
- "description": "A multi-framework Composer library installer",
58
- "homepage": "https://composer.github.io/installers/",
59
- "keywords": [
60
- "Craft",
61
- "Dolibarr",
62
- "Eliasis",
63
- "Hurad",
64
- "ImageCMS",
65
- "Kanboard",
66
- "Lan Management System",
67
- "MODX Evo",
68
- "MantisBT",
69
- "Mautic",
70
- "Maya",
71
- "OXID",
72
- "Plentymarkets",
73
- "Porto",
74
- "RadPHP",
75
- "SMF",
76
- "Thelia",
77
- "Whmcs",
78
- "WolfCMS",
79
- "agl",
80
- "aimeos",
81
- "annotatecms",
82
- "attogram",
83
- "bitrix",
84
- "cakephp",
85
- "chef",
86
- "cockpit",
87
- "codeigniter",
88
- "concrete5",
89
- "croogo",
90
- "dokuwiki",
91
- "drupal",
92
- "eZ Platform",
93
- "elgg",
94
- "expressionengine",
95
- "fuelphp",
96
- "grav",
97
- "installer",
98
- "itop",
99
- "joomla",
100
- "known",
101
- "kohana",
102
- "laravel",
103
- "lavalite",
104
- "lithium",
105
- "magento",
106
- "majima",
107
- "mako",
108
- "mediawiki",
109
- "modulework",
110
- "modx",
111
- "moodle",
112
- "osclass",
113
- "phpbb",
114
- "piwik",
115
- "ppi",
116
- "puppet",
117
- "pxcms",
118
- "reindex",
119
- "roundcube",
120
- "shopware",
121
- "silverstripe",
122
- "sydes",
123
- "sylius",
124
- "symfony",
125
- "typo3",
126
- "wordpress",
127
- "yawik",
128
- "zend",
129
- "zikula"
130
- ],
131
- "support": {
132
- "issues": "https://github.com/composer/installers/issues",
133
- "source": "https://github.com/composer/installers/tree/v1.9.0"
134
- },
135
- "funding": [
136
- {
137
- "url": "https://packagist.com",
138
- "type": "custom"
139
- },
140
- {
141
- "url": "https://tidelift.com/funding/github/packagist/composer/composer",
142
- "type": "tidelift"
143
- }
144
- ],
145
- "install-path": "./installers"
146
- }
147
- ],
148
  "dev": false,
149
  "dev-package-names": []
150
  }
1
  {
2
+ "packages": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  "dev": false,
4
  "dev-package-names": []
5
  }
vendor/composer/installed.php CHANGED
@@ -1,47 +1,23 @@
1
- <?php return array (
2
- 'root' =>
3
- array (
4
- 'pretty_version' => '5.0.4',
5
- 'version' => '5.0.4.0',
6
- 'aliases' =>
7
- array (
 
 
 
8
  ),
9
- 'reference' => 'b8b728c89d6ca99f07f0f3d2777adcd46a6f629a',
10
- 'name' => 'mihdan/cyr2lat',
11
- ),
12
- 'versions' =>
13
- array (
14
- 'composer/installers' =>
15
- array (
16
- 'pretty_version' => 'v1.9.0',
17
- 'version' => '1.9.0.0',
18
- 'aliases' =>
19
- array (
20
- ),
21
- 'reference' => 'b93bcf0fa1fccb0b7d176b0967d969691cd74cca',
22
  ),
23
- 'mihdan/cyr2lat' =>
24
- array (
25
- 'pretty_version' => '5.0.4',
26
- 'version' => '5.0.4.0',
27
- 'aliases' =>
28
- array (
29
- ),
30
- 'reference' => 'b8b728c89d6ca99f07f0f3d2777adcd46a6f629a',
31
- ),
32
- 'roundcube/plugin-installer' =>
33
- array (
34
- 'replaced' =>
35
- array (
36
- 0 => '*',
37
- ),
38
- ),
39
- 'shama/baton' =>
40
- array (
41
- 'replaced' =>
42
- array (
43
- 0 => '*',
44
- ),
45
- ),
46
- ),
47
  );
1
+ <?php return array(
2
+ 'root' => array(
3
+ 'pretty_version' => '5.1.0',
4
+ 'version' => '5.1.0.0',
5
+ 'type' => 'wordpress-plugin',
6
+ 'install_path' => __DIR__ . '/../../',
7
+ 'aliases' => array(),
8
+ 'reference' => '5fc35e835642fb7fe80853de528ddc23f6964a0f',
9
+ 'name' => 'mihdan/cyr2lat',
10
+ 'dev' => false,
11
  ),
12
+ 'versions' => array(
13
+ 'mihdan/cyr2lat' => array(
14
+ 'pretty_version' => '5.1.0',
15
+ 'version' => '5.1.0.0',
16
+ 'type' => 'wordpress-plugin',
17
+ 'install_path' => __DIR__ . '/../../',
18
+ 'aliases' => array(),
19
+ 'reference' => '5fc35e835642fb7fe80853de528ddc23f6964a0f',
20
+ 'dev_requirement' => false,
21
+ ),
 
 
 
22
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  );
vendor/composer/installers/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2012 Kyle Robinson Young
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/composer.json DELETED
@@ -1,112 +0,0 @@
1
- {
2
- "name": "composer/installers",
3
- "type": "composer-plugin",
4
- "license": "MIT",
5
- "description": "A multi-framework Composer library installer",
6
- "keywords": [
7
- "installer",
8
- "Aimeos",
9
- "AGL",
10
- "AnnotateCms",
11
- "Attogram",
12
- "Bitrix",
13
- "CakePHP",
14
- "Chef",
15
- "Cockpit",
16
- "CodeIgniter",
17
- "concrete5",
18
- "Craft",
19
- "Croogo",
20
- "DokuWiki",
21
- "Dolibarr",
22
- "Drupal",
23
- "Elgg",
24
- "Eliasis",
25
- "ExpressionEngine",
26
- "eZ Platform",
27
- "FuelPHP",
28
- "Grav",
29
- "Hurad",
30
- "ImageCMS",
31
- "iTop",
32
- "Joomla",
33
- "Kanboard",
34
- "Known",
35
- "Kohana",
36
- "Lan Management System",
37
- "Laravel",
38
- "Lavalite",
39
- "Lithium",
40
- "Magento",
41
- "majima",
42
- "Mako",
43
- "MantisBT",
44
- "Mautic",
45
- "Maya",
46
- "MODX",
47
- "MODX Evo",
48
- "MediaWiki",
49
- "OXID",
50
- "osclass",
51
- "MODULEWork",
52
- "Moodle",
53
- "Piwik",
54
- "pxcms",
55
- "phpBB",
56
- "Plentymarkets",
57
- "PPI",
58
- "Puppet",
59
- "Porto",
60
- "RadPHP",
61
- "ReIndex",
62
- "Roundcube",
63
- "shopware",
64
- "SilverStripe",
65
- "SMF",
66
- "SyDES",
67
- "Sylius",
68
- "symfony",
69
- "Thelia",
70
- "TYPO3",
71
- "WHMCS",
72
- "WolfCMS",
73
- "WordPress",
74
- "YAWIK",
75
- "Zend",
76
- "Zikula"
77
- ],
78
- "homepage": "https://composer.github.io/installers/",
79
- "authors": [
80
- {
81
- "name": "Kyle Robinson Young",
82
- "email": "kyle@dontkry.com",
83
- "homepage": "https://github.com/shama"
84
- }
85
- ],
86
- "autoload": {
87
- "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
88
- },
89
- "extra": {
90
- "class": "Composer\\Installers\\Plugin",
91
- "branch-alias": {
92
- "dev-master": "1.0-dev"
93
- }
94
- },
95
- "replace": {
96
- "shama/baton": "*",
97
- "roundcube/plugin-installer": "*"
98
- },
99
- "require": {
100
- "composer-plugin-api": "^1.0 || ^2.0"
101
- },
102
- "require-dev": {
103
- "composer/composer": "1.6.* || 2.0.*@dev",
104
- "composer/semver": "1.0.* || 2.0.*@dev",
105
- "phpunit/phpunit": "^4.8.36",
106
- "sebastian/comparator": "^1.2.4",
107
- "symfony/process": "^2.3"
108
- },
109
- "scripts": {
110
- "test": "phpunit"
111
- }
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/AglInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AglInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'More/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
16
- return strtoupper($matches[1]);
17
- }, $vars['name']);
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AimeosInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'ext/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AnnotateCmsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'addons/modules/{$name}/',
8
- 'component' => 'addons/components/{$name}/',
9
- 'service' => 'addons/services/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AsgardInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'Modules/{$name}/',
8
- 'theme' => 'Themes/{$name}/'
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type asgard-module, cut off a trailing '-plugin' if present.
15
- *
16
- * For package type asgard-theme, cut off a trailing '-theme' if present.
17
- *
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- if ($vars['type'] === 'asgard-module') {
22
- return $this->inflectPluginVars($vars);
23
- }
24
-
25
- if ($vars['type'] === 'asgard-theme') {
26
- return $this->inflectThemeVars($vars);
27
- }
28
-
29
- return $vars;
30
- }
31
-
32
- protected function inflectPluginVars($vars)
33
- {
34
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
35
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
-
38
- return $vars;
39
- }
40
-
41
- protected function inflectThemeVars($vars)
42
- {
43
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
-
47
- return $vars;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AttogramInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php DELETED
@@ -1,137 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\IO\IOInterface;
5
- use Composer\Composer;
6
- use Composer\Package\PackageInterface;
7
-
8
- abstract class BaseInstaller
9
- {
10
- protected $locations = array();
11
- protected $composer;
12
- protected $package;
13
- protected $io;
14
-
15
- /**
16
- * Initializes base installer.
17
- *
18
- * @param PackageInterface $package
19
- * @param Composer $composer
20
- * @param IOInterface $io
21
- */
22
- public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
23
- {
24
- $this->composer = $composer;
25
- $this->package = $package;
26
- $this->io = $io;
27
- }
28
-
29
- /**
30
- * Return the install path based on package type.
31
- *
32
- * @param PackageInterface $package
33
- * @param string $frameworkType
34
- * @return string
35
- */
36
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
37
- {
38
- $type = $this->package->getType();
39
-
40
- $prettyName = $this->package->getPrettyName();
41
- if (strpos($prettyName, '/') !== false) {
42
- list($vendor, $name) = explode('/', $prettyName);
43
- } else {
44
- $vendor = '';
45
- $name = $prettyName;
46
- }
47
-
48
- $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
49
-
50
- $extra = $package->getExtra();
51
- if (!empty($extra['installer-name'])) {
52
- $availableVars['name'] = $extra['installer-name'];
53
- }
54
-
55
- if ($this->composer->getPackage()) {
56
- $extra = $this->composer->getPackage()->getExtra();
57
- if (!empty($extra['installer-paths'])) {
58
- $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
59
- if ($customPath !== false) {
60
- return $this->templatePath($customPath, $availableVars);
61
- }
62
- }
63
- }
64
-
65
- $packageType = substr($type, strlen($frameworkType) + 1);
66
- $locations = $this->getLocations();
67
- if (!isset($locations[$packageType])) {
68
- throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
69
- }
70
-
71
- return $this->templatePath($locations[$packageType], $availableVars);
72
- }
73
-
74
- /**
75
- * For an installer to override to modify the vars per installer.
76
- *
77
- * @param array $vars
78
- * @return array
79
- */
80
- public function inflectPackageVars($vars)
81
- {
82
- return $vars;
83
- }
84
-
85
- /**
86
- * Gets the installer's locations
87
- *
88
- * @return array
89
- */
90
- public function getLocations()
91
- {
92
- return $this->locations;
93
- }
94
-
95
- /**
96
- * Replace vars in a path
97
- *
98
- * @param string $path
99
- * @param array $vars
100
- * @return string
101
- */
102
- protected function templatePath($path, array $vars = array())
103
- {
104
- if (strpos($path, '{') !== false) {
105
- extract($vars);
106
- preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
107
- if (!empty($matches[1])) {
108
- foreach ($matches[1] as $var) {
109
- $path = str_replace('{$' . $var . '}', $$var, $path);
110
- }
111
- }
112
- }
113
-
114
- return $path;
115
- }
116
-
117
- /**
118
- * Search through a passed paths array for a custom install path.
119
- *
120
- * @param array $paths
121
- * @param string $name
122
- * @param string $type
123
- * @param string $vendor = NULL
124
- * @return string
125
- */
126
- protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
127
- {
128
- foreach ($paths as $path => $names) {
129
- $names = (array) $names;
130
- if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
131
- return $path;
132
- }
133
- }
134
-
135
- return false;
136
- }
137
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php DELETED
@@ -1,126 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- use Composer\Util\Filesystem;
6
-
7
- /**
8
- * Installer for Bitrix Framework. Supported types of extensions:
9
- * - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
10
- * - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
11
- * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
12
- *
13
- * You can set custom path to directory with Bitrix kernel in `composer.json`:
14
- *
15
- * ```json
16
- * {
17
- * "extra": {
18
- * "bitrix-dir": "s1/bitrix"
19
- * }
20
- * }
21
- * ```
22
- *
23
- * @author Nik Samokhvalov <nik@samokhvalov.info>
24
- * @author Denis Kulichkin <onexhovia@gmail.com>
25
- */
26
- class BitrixInstaller extends BaseInstaller
27
- {
28
- protected $locations = array(
29
- 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
30
- 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
31
- 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
32
- 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
33
- 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
34
- 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
35
- );
36
-
37
- /**
38
- * @var array Storage for informations about duplicates at all the time of installation packages.
39
- */
40
- private static $checkedDuplicates = array();
41
-
42
- /**
43
- * {@inheritdoc}
44
- */
45
- public function inflectPackageVars($vars)
46
- {
47
- if ($this->composer->getPackage()) {
48
- $extra = $this->composer->getPackage()->getExtra();
49
-
50
- if (isset($extra['bitrix-dir'])) {
51
- $vars['bitrix_dir'] = $extra['bitrix-dir'];
52
- }
53
- }
54
-
55
- if (!isset($vars['bitrix_dir'])) {
56
- $vars['bitrix_dir'] = 'bitrix';
57
- }
58
-
59
- return parent::inflectPackageVars($vars);
60
- }
61
-
62
- /**
63
- * {@inheritdoc}
64
- */
65
- protected function templatePath($path, array $vars = array())
66
- {
67
- $templatePath = parent::templatePath($path, $vars);
68
- $this->checkDuplicates($templatePath, $vars);
69
-
70
- return $templatePath;
71
- }
72
-
73
- /**
74
- * Duplicates search packages.
75
- *
76
- * @param string $path
77
- * @param array $vars
78
- */
79
- protected function checkDuplicates($path, array $vars = array())
80
- {
81
- $packageType = substr($vars['type'], strlen('bitrix') + 1);
82
- $localDir = explode('/', $vars['bitrix_dir']);
83
- array_pop($localDir);
84
- $localDir[] = 'local';
85
- $localDir = implode('/', $localDir);
86
-
87
- $oldPath = str_replace(
88
- array('{$bitrix_dir}', '{$name}'),
89
- array($localDir, $vars['name']),
90
- $this->locations[$packageType]
91
- );
92
-
93
- if (in_array($oldPath, static::$checkedDuplicates)) {
94
- return;
95
- }
96
-
97
- if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
98
-
99
- $this->io->writeError(' <error>Duplication of packages:</error>');
100
- $this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
101
-
102
- while (true) {
103
- switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
104
- case 'y':
105
- $fs = new Filesystem();
106
- $fs->removeDirectory($oldPath);
107
- break 2;
108
-
109
- case 'n':
110
- break 2;
111
-
112
- case '?':
113
- default:
114
- $this->io->writeError(array(
115
- ' y - delete package ' . $oldPath . ' and to continue with the installation',
116
- ' n - don\'t delete and to continue with the installation',
117
- ));
118
- $this->io->writeError(' ? - print help');
119
- break;
120
- }
121
- }
122
- }
123
-
124
- static::$checkedDuplicates[] = $oldPath;
125
- }
126
- }