Cyr-To-Lat - Version 4.3.2

Version Description

(29.12.2019) = * Fixed problems with setting of max_input_vars on some hostings

Download this release

Release Info

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

Code changes from version 4.3.1 to 4.3.2

Files changed (106) hide show
  1. classes/class-admin-notices.php +32 -1
  2. classes/class-requirements.php +50 -16
  3. classes/class-settings.php +0 -6
  4. cyr-to-lat.php +4 -4
  5. readme.txt +4 -1
  6. vendor/autoload.php +1 -1
  7. vendor/composer/ClassLoader.php +2 -2
  8. vendor/composer/LICENSE +17 -52
  9. vendor/composer/autoload_real.php +4 -4
  10. vendor/composer/autoload_static.php +4 -4
  11. vendor/composer/installers/composer.json +107 -0
  12. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +21 -0
  13. vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +9 -0
  14. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +11 -0
  15. vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +49 -0
  16. vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +9 -0
  17. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +136 -0
  18. vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +126 -0
  19. vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +9 -0
  20. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +82 -0
  21. vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +11 -0
  22. vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php +9 -0
  23. vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +10 -0
  24. vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +34 -0
  25. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +11 -0
  26. vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +13 -0
  27. vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +35 -0
  28. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +21 -0
  29. vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +10 -0
  30. vendor/composer/installers/src/Composer/Installers/DframeInstaller.php +10 -0
  31. vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +50 -0
  32. vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +16 -0
  33. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +20 -0
  34. vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +9 -0
  35. vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +12 -0
  36. vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +29 -0
  37. vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +10 -0
  38. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +11 -0
  39. vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +9 -0
  40. vendor/composer/installers/src/Composer/Installers/GravInstaller.php +30 -0
  41. vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +25 -0
  42. vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +11 -0
  43. vendor/composer/installers/src/Composer/Installers/Installer.php +278 -0
  44. vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +9 -0
  45. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +15 -0
  46. vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +18 -0
  47. vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +11 -0
  48. vendor/composer/installers/src/Composer/Installers/KnownInstaller.php +11 -0
  49. vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +10 -0
  50. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +9 -0
  51. vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +27 -0
  52. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +9 -0
  53. vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +10 -0
  54. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +10 -0
  55. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +9 -0
  56. vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +16 -0
  57. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +11 -0
  58. vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +37 -0
  59. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +9 -0
  60. vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +25 -0
  61. vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +33 -0
  62. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +51 -0
  63. vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +119 -0
  64. vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +12 -0
  65. vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +58 -0
  66. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +47 -0
  67. vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +24 -0
  68. vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +14 -0
  69. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +59 -0
  70. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +9 -0
  71. vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +11 -0
  72. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +11 -0
  73. vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +21 -0
  74. vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +32 -0
  75. vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +29 -0
  76. vendor/composer/installers/src/Composer/Installers/Plugin.php +17 -0
  77. vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +9 -0
  78. vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +10 -0
  79. vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +11 -0
  80. vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +63 -0
  81. vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +24 -0
  82. vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +10 -0
  83. vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php +10 -0
  84. vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +10 -0
  85. vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +22 -0
  86. vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +10 -0
  87. vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +60 -0
  88. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +35 -0
  89. vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +25 -0
  90. vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +49 -0
  91. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +26 -0
  92. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +16 -0
  93. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +38 -0
  94. vendor/composer/installers/src/Composer/Installers/TaoInstaller.php +12 -0
  95. vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +12 -0
  96. vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +14 -0
  97. vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +9 -0
  98. vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +10 -0
  99. vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +49 -0
  100. vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +21 -0
  101. vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +9 -0
  102. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +12 -0
  103. vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +32 -0
  104. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +11 -0
  105. vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +10 -0
  106. vendor/composer/installers/src/bootstrap.php +13 -0
classes/class-admin-notices.php CHANGED
@@ -34,11 +34,13 @@ class Admin_Notices {
34
  * @param string $message Message to show.
35
  * @param string $class Message class: notice notice-success notice-error notice-warning notice-info
36
  * is-dismissible.
 
37
  */
38
- public function add_notice( $message, $class = 'notice' ) {
39
  $this->notices[] = [
40
  'message' => $message,
41
  'class' => $class,
 
42
  ];
43
  }
44
 
@@ -47,6 +49,10 @@ class Admin_Notices {
47
  */
48
  public function show_notices() {
49
  foreach ( $this->notices as $notice ) {
 
 
 
 
50
  ?>
51
  <div class="<?php echo esc_attr( $notice['class'] ); ?>">
52
  <p>
@@ -58,4 +64,29 @@ class Admin_Notices {
58
  <?php
59
  }
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
34
  * @param string $message Message to show.
35
  * @param string $class Message class: notice notice-success notice-error notice-warning notice-info
36
  * is-dismissible.
37
+ * @param array $options Notice options.
38
  */
39
+ public function add_notice( $message, $class = 'notice', $options = [] ) {
40
  $this->notices[] = [
41
  'message' => $message,
42
  'class' => $class,
43
+ 'options' => $options,
44
  ];
45
  }
46
 
49
  */
50
  public function show_notices() {
51
  foreach ( $this->notices as $notice ) {
52
+ if ( ! $this->is_page_allowed( $notice ) ) {
53
+ continue;
54
+ }
55
+
56
  ?>
57
  <div class="<?php echo esc_attr( $notice['class'] ); ?>">
58
  <p>
64
  <?php
65
  }
66
  }
67
+
68
+ /**
69
+ * Is current admin screen allowed to show the notice.
70
+ *
71
+ * @param array $notice Notice.
72
+ *
73
+ * @return bool
74
+ */
75
+ protected function is_page_allowed( $notice ) {
76
+ $page = isset( $notice['options']['page'] ) ? $notice['options']['page'] : null;
77
+ if ( ! $page ) {
78
+ return true;
79
+ }
80
+ $pages = (array) $page;
81
+
82
+ $current_screen = get_current_screen();
83
+
84
+ foreach ( $pages as $page ) {
85
+ if ( $current_screen && $page === $current_screen->id ) {
86
+ return true;
87
+ }
88
+ }
89
+
90
+ return false;
91
+ }
92
  }
classes/class-requirements.php CHANGED
@@ -27,10 +27,17 @@ if ( ! class_exists( __NAMESPACE__ . '\Requirements' ) ) {
27
  /**
28
  * WP file system direct.
29
  *
30
- * @var WP_Filesystem_Direct;
31
  */
32
  protected $wp_filesystem;
33
 
 
 
 
 
 
 
 
34
  /**
35
  * Requirements constructor.
36
  *
@@ -45,6 +52,8 @@ if ( ! class_exists( __NAMESPACE__ . '\Requirements' ) ) {
45
  $this->admin_notices = new Admin_Notices();
46
  }
47
 
 
 
48
  if ( ! function_exists( 'WP_Filesystem' ) ) {
49
  // @codeCoverageIgnoreStart
50
  /**
@@ -57,7 +66,7 @@ if ( ! class_exists( __NAMESPACE__ . '\Requirements' ) ) {
57
  }
58
 
59
  if ( ! WP_Filesystem() ) {
60
- throw new RuntimeException( __( 'Unable to get filesystem access.', 'cyr2lat' ) );
61
  }
62
 
63
  $this->wp_filesystem = $wp_filesystem;
@@ -126,33 +135,42 @@ if ( ! class_exists( __NAMESPACE__ . '\Requirements' ) ) {
126
  */
127
  private function is_max_input_vars_required() {
128
  if ( CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS > ini_get( 'max_input_vars' ) ) {
129
- $this->try_to_fix_max_input_vars();
 
 
 
 
 
 
 
 
 
 
 
130
  }
131
 
132
  if ( CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS > ini_get( 'max_input_vars' ) ) {
133
- /* translators: 1: max_input_vars value, 2: Cyr To Lat version, 3: Minimum required max_input_vars */
134
- $message = sprintf( __( 'Your server is running PHP with max_input_vars=%1$d but Cyr To Lat %2$s requires at least %3$d.', 'cyr2lat' ), ini_get( 'max_input_vars' ), CYR_TO_LAT_VERSION, CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS );
135
-
136
- $message .= '<br>';
137
- /* translators: 1: .user.ini filename */
138
- $message .= sprintf( __( 'We have updated settings in %s.', 'cyr2lat' ), realpath( $this->get_user_ini_filename() ) );
139
-
140
  $mtime = $this->wp_filesystem->mtime( $this->get_user_ini_filename() );
141
  $ini_ttl = intval( ini_get( 'user_ini.cache_ttl' ) );
142
  $time_left = ( $mtime + $ini_ttl ) - time();
143
 
144
- $message .= '<br>';
145
-
146
  if ( 0 < $time_left ) {
 
 
 
 
 
 
 
147
  /* translators: 1: Wait time in seconds */
148
  $message .= sprintf( __( 'Please try again in %d s.', 'cyr2lat' ), $time_left );
 
 
149
  } else {
150
- $message .= sprintf( __( 'Please try again.', 'cyr2lat' ), $time_left );
151
  }
152
 
153
- $this->admin_notices->add_notice( $message, 'notice notice-error' );
154
-
155
- return false;
156
  }
157
 
158
  return true;
@@ -206,5 +224,21 @@ if ( ! class_exists( __NAMESPACE__ . '\Requirements' ) ) {
206
  private function get_user_ini_filename() {
207
  return ABSPATH . 'wp-admin/' . ini_get( 'user_ini.filename' );
208
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  }
210
  }
27
  /**
28
  * WP file system direct.
29
  *
30
+ * @var WP_Filesystem_Direct
31
  */
32
  protected $wp_filesystem;
33
 
34
+ /**
35
+ * Restrict notice to Cyr To Lat settings page.
36
+ *
37
+ * @var array
38
+ */
39
+ protected $cyr2lat_page;
40
+
41
  /**
42
  * Requirements constructor.
43
  *
52
  $this->admin_notices = new Admin_Notices();
53
  }
54
 
55
+ $this->cyr2lat_page = [ 'page' => Settings::SCREEN_ID ];
56
+
57
  if ( ! function_exists( 'WP_Filesystem' ) ) {
58
  // @codeCoverageIgnoreStart
59
  /**
66
  }
67
 
68
  if ( ! WP_Filesystem() ) {
69
+ return;
70
  }
71
 
72
  $this->wp_filesystem = $wp_filesystem;
135
  */
136
  private function is_max_input_vars_required() {
137
  if ( CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS > ini_get( 'max_input_vars' ) ) {
138
+ if ( $this->wp_filesystem ) {
139
+ $this->try_to_fix_max_input_vars();
140
+ } else {
141
+ $this->admin_notices->add_notice(
142
+ __( 'Unable to get filesystem access.', 'cyr2lat' ),
143
+ 'notice notice-error',
144
+ $this->cyr2lat_page
145
+ );
146
+ $this->ask_to_increase_max_input_vars();
147
+
148
+ return true;
149
+ }
150
  }
151
 
152
  if ( CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS > ini_get( 'max_input_vars' ) ) {
 
 
 
 
 
 
 
153
  $mtime = $this->wp_filesystem->mtime( $this->get_user_ini_filename() );
154
  $ini_ttl = intval( ini_get( 'user_ini.cache_ttl' ) );
155
  $time_left = ( $mtime + $ini_ttl ) - time();
156
 
 
 
157
  if ( 0 < $time_left ) {
158
+ /* translators: 1: max_input_vars value, 2: Cyr To Lat version, 3: Minimum required max_input_vars */
159
+ $message = sprintf( __( 'Your server is running PHP with max_input_vars=%1$d but Cyr To Lat %2$s requires at least %3$d.', 'cyr2lat' ), ini_get( 'max_input_vars' ), CYR_TO_LAT_VERSION, CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS );
160
+
161
+ $message .= '<br>';
162
+ /* translators: 1: .user.ini filename */
163
+ $message .= sprintf( __( 'We have updated settings in %s.', 'cyr2lat' ), realpath( $this->get_user_ini_filename() ) );
164
+ $message .= '<br>';
165
  /* translators: 1: Wait time in seconds */
166
  $message .= sprintf( __( 'Please try again in %d s.', 'cyr2lat' ), $time_left );
167
+
168
+ $this->admin_notices->add_notice( $message, 'notice notice-error', $this->cyr2lat_page );
169
  } else {
170
+ $this->ask_to_increase_max_input_vars();
171
  }
172
 
173
+ return true;
 
 
174
  }
175
 
176
  return true;
224
  private function get_user_ini_filename() {
225
  return ABSPATH . 'wp-admin/' . ini_get( 'user_ini.filename' );
226
  }
227
+
228
+ /**
229
+ * Asl user to increase max_input_vars.
230
+ */
231
+ private function ask_to_increase_max_input_vars() {
232
+ $message = __( 'Please increase max input vars limit up to 1500.', 'cyr2lat' );
233
+
234
+ $message .= '<br>';
235
+ $message .= __( 'See: <a href="http://sevenspark.com/docs/ubermenu-3/faqs/menu-item-limit" target="_blank">Increasing max input vars limit.</a>', 'cyr2lat' );
236
+
237
+ $this->admin_notices->add_notice(
238
+ $message,
239
+ 'notice notice-error',
240
+ [ 'page' => Settings::SCREEN_ID ]
241
+ );
242
+ }
243
  }
244
  }
classes/class-settings.php CHANGED
@@ -410,12 +410,6 @@ class Settings {
410
  [ $this, 'cyr_to_lat_section' ],
411
  self::PAGE
412
  );
413
- add_settings_section(
414
- 'zh_CN_section',
415
- __( 'zh_CN Table', 'cyr2lat' ),
416
- [ $this, 'cyr_to_lat_section' ],
417
- self::PAGE
418
- );
419
  }
420
 
421
  /**
410
  [ $this, 'cyr_to_lat_section' ],
411
  self::PAGE
412
  );
 
 
 
 
 
 
413
  }
414
 
415
  /**
cyr-to-lat.php CHANGED
@@ -9,8 +9,8 @@
9
  * Author URI: https://profiles.wordpress.org/sergeybiryukov/
10
  * Requires at least: 5.1
11
  * Tested up to: 5.3
12
- * Version: 4.3.1
13
- * Stable tag: 4.3.1
14
  *
15
  * Text Domain: cyr2lat
16
  * Domain Path: /languages/
@@ -30,7 +30,7 @@ if ( ! defined( 'CYR_TO_LAT_VERSION' ) ) {
30
  /**
31
  * Plugin version.
32
  */
33
- define( 'CYR_TO_LAT_VERSION', '4.3.1' );
34
  }
35
 
36
  if ( ! defined( 'CYR_TO_LAT_PATH' ) ) {
@@ -86,7 +86,7 @@ if ( ! defined( 'CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS' ) ) {
86
  /**
87
  * Minimum required max_input_vars value.
88
  */
89
- define( 'CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS', 5000 );
90
  }
91
  // @codeCoverageIgnoreEnd
92
 
9
  * Author URI: https://profiles.wordpress.org/sergeybiryukov/
10
  * Requires at least: 5.1
11
  * Tested up to: 5.3
12
+ * Version: 4.3.2
13
+ * Stable tag: 4.3.2
14
  *
15
  * Text Domain: cyr2lat
16
  * Domain Path: /languages/
30
  /**
31
  * Plugin version.
32
  */
33
+ define( 'CYR_TO_LAT_VERSION', '4.3.2' );
34
  }
35
 
36
  if ( ! defined( 'CYR_TO_LAT_PATH' ) ) {
86
  /**
87
  * Minimum required max_input_vars value.
88
  */
89
+ define( 'CYR_TO_LAT_REQUIRED_MAX_INPUT_VARS', 1000 );
90
  }
91
  // @codeCoverageIgnoreEnd
92
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.3
6
- Stable tag: 4.3.1
7
  Requires PHP: 5.6.20
8
 
9
  Converts Cyrillic characters in post, page and term slugs to Latin characters.
@@ -91,6 +91,9 @@ Yes you can!
91
 
92
  == Changelog ==
93
 
 
 
 
94
  = 4.3.1 (27.12.2019) =
95
  * Added requirement to have max_input_vars >= 5000
96
  * Added automatic plugin deactivation if requirements are not met
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.3
6
+ Stable tag: 4.3.2
7
  Requires PHP: 5.6.20
8
 
9
  Converts Cyrillic characters in post, page and term slugs to Latin characters.
91
 
92
  == Changelog ==
93
 
94
+ = 4.3.2 (29.12.2019) =
95
+ * Fixed problems with setting of max_input_vars on some hostings
96
+
97
  = 4.3.1 (27.12.2019) =
98
  * Added requirement to have max_input_vars >= 5000
99
  * Added automatic plugin deactivation if requirements are not met
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -279,7 +279,7 @@ class ClassLoader
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
  }
284
 
285
  /**
@@ -377,7 +377,7 @@ class ClassLoader
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath . '\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
  $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
  }
284
 
285
  /**
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath.'\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
  $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
vendor/composer/LICENSE CHANGED
@@ -1,56 +1,21 @@
1
- Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2
- Upstream-Name: Composer
3
- Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be>
4
- Source: https://github.com/composer/composer
5
 
6
- Files: *
7
- Copyright: 2016, Nils Adermann <naderman@naderman.de>
8
- 2016, Jordi Boggiano <j.boggiano@seld.be>
9
- License: Expat
10
 
11
- Files: src/Composer/Util/TlsHelper.php
12
- Copyright: 2016, Nils Adermann <naderman@naderman.de>
13
- 2016, Jordi Boggiano <j.boggiano@seld.be>
14
- 2013, Evan Coury <me@evancoury.com>
15
- License: Expat and BSD-2-Clause
 
16
 
17
- License: BSD-2-Clause
18
- Redistribution and use in source and binary forms, with or without modification,
19
- are permitted provided that the following conditions are met:
20
- .
21
- * Redistributions of source code must retain the above copyright notice,
22
- this list of conditions and the following disclaimer.
23
- .
24
- * Redistributions in binary form must reproduce the above copyright notice,
25
- this list of conditions and the following disclaimer in the documentation
26
- and/or other materials provided with the distribution.
27
- .
28
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
32
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
33
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
 
39
- License: Expat
40
- Permission is hereby granted, free of charge, to any person obtaining a copy
41
- of this software and associated documentation files (the "Software"), to deal
42
- in the Software without restriction, including without limitation the rights
43
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
- copies of the Software, and to permit persons to whom the Software is furnished
45
- to do so, subject to the following conditions:
46
- .
47
- The above copyright notice and this permission notice shall be included in all
48
- copies or substantial portions of the Software.
49
- .
50
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
56
- THE SOFTWARE.
 
 
 
 
1
 
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
 
 
 
3
 
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
 
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit889b56da8e5c956977b4e015c55d5852', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit889b56da8e5c956977b4e015c55d5852::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit19d4b07fb39b1ad38f5986a3c11b2a54', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit889b56da8e5c956977b4e015c55d5852
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -40,9 +40,9 @@ class ComposerStaticInit889b56da8e5c956977b4e015c55d5852
40
  public static function getInitializer(ClassLoader $loader)
41
  {
42
  return \Closure::bind(function () use ($loader) {
43
- $loader->prefixLengthsPsr4 = ComposerStaticInit889b56da8e5c956977b4e015c55d5852::$prefixLengthsPsr4;
44
- $loader->prefixDirsPsr4 = ComposerStaticInit889b56da8e5c956977b4e015c55d5852::$prefixDirsPsr4;
45
- $loader->classMap = ComposerStaticInit889b56da8e5c956977b4e015c55d5852::$classMap;
46
 
47
  }, null, ClassLoader::class);
48
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
40
  public static function getInitializer(ClassLoader $loader)
41
  {
42
  return \Closure::bind(function () use ($loader) {
43
+ $loader->prefixLengthsPsr4 = ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54::$prefixLengthsPsr4;
44
+ $loader->prefixDirsPsr4 = ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54::$prefixDirsPsr4;
45
+ $loader->classMap = ComposerStaticInit19d4b07fb39b1ad38f5986a3c11b2a54::$classMap;
46
 
47
  }, null, ClassLoader::class);
48
  }
vendor/composer/installers/composer.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "Mautic",
44
+ "Maya",
45
+ "MODX",
46
+ "MODX Evo",
47
+ "MediaWiki",
48
+ "OXID",
49
+ "osclass",
50
+ "MODULEWork",
51
+ "Moodle",
52
+ "Piwik",
53
+ "pxcms",
54
+ "phpBB",
55
+ "Plentymarkets",
56
+ "PPI",
57
+ "Puppet",
58
+ "Porto",
59
+ "RadPHP",
60
+ "ReIndex",
61
+ "Roundcube",
62
+ "shopware",
63
+ "SilverStripe",
64
+ "SMF",
65
+ "SyDES",
66
+ "symfony",
67
+ "Thelia",
68
+ "TYPO3",
69
+ "WHMCS",
70
+ "WolfCMS",
71
+ "WordPress",
72
+ "YAWIK",
73
+ "Zend",
74
+ "Zikula"
75
+ ],
76
+ "homepage": "https://composer.github.io/installers/",
77
+ "authors": [
78
+ {
79
+ "name": "Kyle Robinson Young",
80
+ "email": "kyle@dontkry.com",
81
+ "homepage": "https://github.com/shama"
82
+ }
83
+ ],
84
+ "autoload": {
85
+ "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
86
+ },
87
+ "extra": {
88
+ "class": "Composer\\Installers\\Plugin",
89
+ "branch-alias": {
90
+ "dev-master": "1.0-dev"
91
+ }
92
+ },
93
+ "replace": {
94
+ "shama/baton": "*",
95
+ "roundcube/plugin-installer": "*"
96
+ },
97
+ "require": {
98
+ "composer-plugin-api": "^1.0"
99
+ },
100
+ "require-dev": {
101
+ "composer/composer": "1.0.*@dev",
102
+ "phpunit/phpunit": "^4.8.36"
103
+ },
104
+ "scripts": {
105
+ "test": "phpunit"
106
+ }
107
+ }
vendor/composer/installers/src/Composer/Installers/AglInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
130
+ return $path;
131
+ }
132
+ }
133
+
134
+ return false;
135
+ }
136
+ }
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class BonefishInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'Packages/{$vendor}/{$name}/'
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\DependencyResolver\Pool;
5
+
6
+ class CakePHPInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'plugin' => 'Plugin/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name to CamelCase
14
+ */
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
18
+ return $vars;
19
+ }
20
+
21
+ $nameParts = explode('/', $vars['name']);
22
+ foreach ($nameParts as &$value) {
23
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
24
+ $value = str_replace(array('-', '_'), ' ', $value);
25
+ $value = str_replace(' ', '', ucwords($value));
26
+ }
27
+ $vars['name'] = implode('/', $nameParts);
28
+
29
+ return $vars;
30
+ }
31
+
32
+ /**
33
+ * Change the default plugin location when cakephp >= 3.0
34
+ */
35
+ public function getLocations()
36
+ {
37
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
38
+ $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
39
+ }
40
+ return $this->locations;
41
+ }
42
+
43
+ /**
44
+ * Check if CakePHP version matches against a version
45
+ *
46
+ * @param string $matcher
47
+ * @param string $version
48
+ * @return bool
49
+ */
50
+ protected function matchesCakeVersion($matcher, $version)
51
+ {
52
+ if (class_exists('Composer\Semver\Constraint\MultiConstraint')) {
53
+ $multiClass = 'Composer\Semver\Constraint\MultiConstraint';
54
+ $constraintClass = 'Composer\Semver\Constraint\Constraint';
55
+ } else {
56
+ $multiClass = 'Composer\Package\LinkConstraint\MultiConstraint';
57
+ $constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint';
58
+ }
59
+
60
+ $repositoryManager = $this->composer->getRepositoryManager();
61
+ if ($repositoryManager) {
62
+ $repos = $repositoryManager->getLocalRepository();
63
+ if (!$repos) {
64
+ return false;
65
+ }
66
+ $cake3 = new $multiClass(array(
67
+ new $constraintClass($matcher, $version),
68
+ new $constraintClass('!=', '9999999-dev'),
69
+ ));
70
+ $pool = new Pool('dev');
71
+ $pool->addRepository($repos);
72
+ $packages = $pool->whatProvides('cakephp/cakephp');
73
+ foreach ($packages as $package) {
74
+ $installed = new $constraintClass('=', $package->getVersion());
75
+ if ($cake3->matches($installed)) {
76
+ return true;
77
+ }
78
+ }
79
+ }
80
+ return false;
81
+ }
82
+ }
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ChefInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'cookbook' => 'Chef/{$vendor}/{$name}/',
8
+ 'role' => 'Chef/roles/{$name}/',
9
+ );
10
+ }
11
+
vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CiviCrmInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ext' => 'ext/{$name}/'
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ClanCatsFrameworkInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ship' => 'CCF/orbit/{$name}/',
8
+ 'theme' => 'CCF/app/themes/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CockpitInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'cockpit/modules/addons/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format module name.
12
+ *
13
+ * Strip `module-` prefix from package name.
14
+ *
15
+ * @param array @vars
16
+ *
17
+ * @return array
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] == 'cockpit-module') {
22
+ return $this->inflectModuleVars($vars);
23
+ }
24
+
25
+ return $vars;
26
+ }
27
+
28
+ public function inflectModuleVars($vars)
29
+ {
30
+ $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
31
+
32
+ return $vars;
33
+ }
34
+ }
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CodeIgniterInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'application/libraries/{$name}/',
8
+ 'third-party' => 'application/third_party/{$name}/',
9
+ 'module' => 'application/modules/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class Concrete5Installer extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'concrete/',
8
+ 'block' => 'application/blocks/{$name}/',
9
+ 'package' => 'packages/{$name}/',
10
+ 'theme' => 'application/themes/{$name}/',
11
+ 'update' => 'updates/{$name}/',
12
+ );
13
+ }
vendor/composer/installers/src/Composer/Installers/CraftInstaller.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Installer for Craft Plugins
6
+ */
7
+ class CraftInstaller extends BaseInstaller
8
+ {
9
+ const NAME_PREFIX = 'craft';
10
+ const NAME_SUFFIX = 'plugin';
11
+
12
+ protected $locations = array(
13
+ 'plugin' => 'craft/plugins/{$name}/',
14
+ );
15
+
16
+ /**
17
+ * Strip `craft-` prefix and/or `-plugin` suffix from package names
18
+ *
19
+ * @param array $vars
20
+ *
21
+ * @return array
22
+ */
23
+ final public function inflectPackageVars($vars)
24
+ {
25
+ return $this->inflectPluginVars($vars);
26
+ }
27
+
28
+ private function inflectPluginVars($vars)
29
+ {
30
+ $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
31
+ $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);
32
+
33
+ return $vars;
34
+ }
35
+ }
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CroogoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'Plugin/{$name}/',
8
+ 'theme' => 'View/Themed/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DecibelInstaller extends BaseInstaller
5
+ {
6
+ /** @var array */
7
+ protected $locations = array(
8
+ 'app' => 'app/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/DframeInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class DframeInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'module' => 'modules/{$vendor}/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DokuWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'lib/plugins/{$name}/',
8
+ 'template' => 'lib/tpl/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15
+ * or leading dokuwiki_ if present.
16
+ *
17
+ * For package type dokuwiki-template, cut off a trailing '-template' if present.
18
+ *
19
+ */
20
+ public function inflectPackageVars($vars)
21
+ {
22
+
23
+ if ($vars['type'] === 'dokuwiki-plugin') {
24
+ return $this->inflectPluginVars($vars);
25
+ }
26
+
27
+ if ($vars['type'] === 'dokuwiki-template') {
28
+ return $this->inflectTemplateVars($vars);
29
+ }
30
+
31
+ return $vars;
32
+ }
33
+
34
+ protected function inflectPluginVars($vars)
35
+ {
36
+ $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37
+ $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
38
+
39
+ return $vars;
40
+ }
41
+
42
+ protected function inflectTemplateVars($vars)
43
+ {
44
+ $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45
+ $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
46
+
47
+ return $vars;
48
+ }
49
+
50
+ }
vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Class DolibarrInstaller
6
+ *
7
+ * @package Composer\Installers
8
+ * @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
9
+ */
10
+ class DolibarrInstaller extends BaseInstaller
11
+ {
12
+ //TODO: Add support for scripts and themes
13
+ protected $locations = array(
14
+ 'module' => 'htdocs/custom/{$name}/',
15
+ );
16
+ }
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DrupalInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'core/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'theme' => 'themes/{$name}/',
10
+ 'library' => 'libraries/{$name}/',
11
+ 'profile' => 'profiles/{$name}/',
12
+ 'drush' => 'drush/{$name}/',
13
+ 'custom-theme' => 'themes/custom/{$name}/',
14
+ 'custom-module' => 'modules/custom/{$name}/',
15
+ 'custom-profile' => 'profiles/custom/{$name}/',
16
+ 'drupal-multisite' => 'sites/{$name}/',
17
+ 'console' => 'console/{$name}/',
18
+ 'console-language' => 'console/language/{$name}/',
19
+ );
20
+ }
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ElggInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'mod/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class EliasisInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'plugin' => 'plugins/{$name}/',
10
+ 'template' => 'templates/{$name}/',
11
+ );
12
+ }
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class ExpressionEngineInstaller extends BaseInstaller
7
+ {
8
+
9
+ protected $locations = array();
10
+
11
+ private $ee2Locations = array(
12
+ 'addon' => 'system/expressionengine/third_party/{$name}/',
13
+ 'theme' => 'themes/third_party/{$name}/',
14
+ );
15
+
16
+ private $ee3Locations = array(
17
+ 'addon' => 'system/user/addons/{$name}/',
18
+ 'theme' => 'themes/user/{$name}/',
19
+ );
20
+
21
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
22
+ {
23
+
24
+ $version = "{$frameworkType}Locations";
25
+ $this->locations = $this->$version;
26
+
27
+ return parent::getInstallPath($package, $frameworkType);
28
+ }
29
+ }
vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class EzPlatformInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'meta-assets' => 'web/assets/ezplatform/',
8
+ 'assets' => 'web/assets/ezplatform/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'fuel/app/modules/{$name}/',
8
+ 'package' => 'fuel/packages/{$name}/',
9
+ 'theme' => 'fuel/app/themes/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelphpInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/GravInstaller.php ADDED
@@ -0,0 +1,30 @@