ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video …) - Version 8.10.12

Version Description

Download this release

Release Info

Developer nico23
Plugin Icon 128x128 ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video …)
Version 8.10.12
Comparing to
See all releases

Code changes from version 8.10.10 to 8.10.12

Files changed (163) hide show
  1. admin/class-arve-admin-notice-factory.php +8 -8
  2. admin/class-nextgenthemes-plugin-updater.php +26 -4
  3. admin/functions-admin.php +67 -88
  4. admin/functions-licensing.php +87 -75
  5. admin/html-debug-info.php +27 -21
  6. admin/html-settings-page.php +2 -2
  7. admin/index.php +1 -1
  8. advanced-responsive-video-embedder.php +2 -3
  9. public/functions-html-output.php +12 -13
  10. public/functions-misc.php +12 -6
  11. public/functions-shortcode-data.php +106 -140
  12. public/functions-shortcode-filters.php +54 -63
  13. public/functions-shortcodes.php +15 -14
  14. public/functions-thumbnails.php +7 -5
  15. public/functions-url-handlers.php +22 -18
  16. public/functions-validation.php +8 -15
  17. public/index.php +0 -1
  18. readme.txt +9 -1
  19. shared/functions-shared.php +436 -541
  20. shared/index.php +0 -1
  21. vendor/autoload.php +0 -7
  22. vendor/composer/ClassLoader.php +0 -445
  23. vendor/composer/LICENSE +0 -21
  24. vendor/composer/autoload_classmap.php +0 -9
  25. vendor/composer/autoload_namespaces.php +0 -9
  26. vendor/composer/autoload_psr4.php +0 -11
  27. vendor/composer/autoload_real.php +0 -52
  28. vendor/composer/autoload_static.php +0 -39
  29. vendor/composer/installed.json +0 -172
  30. vendor/composer/installers/.editorconfig +0 -10
  31. vendor/composer/installers/.gitignore +0 -3
  32. vendor/composer/installers/.travis.yml +0 -33
  33. vendor/composer/installers/CHANGELOG.md +0 -86
  34. vendor/composer/installers/CONTRIBUTING.md +0 -24
  35. vendor/composer/installers/LICENSE +0 -19
  36. vendor/composer/installers/README.md +0 -221
  37. vendor/composer/installers/_config.yml +0 -1
  38. vendor/composer/installers/composer.json +0 -105
  39. vendor/composer/installers/phpunit.xml.dist +0 -25
  40. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +0 -21
  41. vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +0 -9
  42. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +0 -11
  43. vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +0 -49
  44. vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +0 -9
  45. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +0 -136
  46. vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +0 -126
  47. vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +0 -9
  48. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +0 -82
  49. vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +0 -11
  50. vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +0 -10
  51. vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +0 -34
  52. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +0 -11
  53. vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +0 -13
  54. vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +0 -35
  55. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +0 -21
  56. vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +0 -10
  57. vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +0 -50
  58. vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +0 -16
  59. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +0 -16
  60. vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +0 -9
  61. vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +0 -12
  62. vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +0 -29
  63. vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +0 -10
  64. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +0 -11
  65. vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +0 -9
  66. vendor/composer/installers/src/Composer/Installers/GravInstaller.php +0 -30
  67. vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +0 -25
  68. vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +0 -11
  69. vendor/composer/installers/src/Composer/Installers/Installer.php +0 -200
  70. vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +0 -9
  71. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +0 -15
  72. vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +0 -18
  73. vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +0 -11
  74. vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +0 -10
  75. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +0 -9
  76. vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +0 -27
  77. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +0 -9
  78. vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +0 -10
  79. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +0 -10
  80. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +0 -9
  81. vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +0 -16
  82. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +0 -11
  83. vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +0 -37
  84. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +0 -9
  85. vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +0 -25
  86. vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +0 -33
  87. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +0 -50
  88. vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +0 -111
  89. vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +0 -12
  90. vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +0 -57
  91. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +0 -46
  92. vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +0 -24
  93. vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +0 -14
  94. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +0 -59
  95. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +0 -9
  96. vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +0 -11
  97. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +0 -11
  98. vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +0 -21
  99. vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +0 -32
  100. vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +0 -29
  101. vendor/composer/installers/src/Composer/Installers/Plugin.php +0 -17
  102. vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +0 -9
  103. vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +0 -10
  104. vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +0 -11
  105. vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +0 -63
  106. vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +0 -24
  107. vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +0 -10
  108. vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +0 -10
  109. vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +0 -22
  110. vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +0 -10
  111. vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +0 -60
  112. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +0 -35
  113. vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +0 -25
  114. vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +0 -49
  115. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +0 -26
  116. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +0 -16
  117. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +0 -38
  118. vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +0 -12
  119. vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +0 -14
  120. vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +0 -9
  121. vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +0 -10
  122. vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +0 -49
  123. vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +0 -10
  124. vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +0 -9
  125. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +0 -12
  126. vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +0 -32
  127. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +0 -11
  128. vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +0 -10
  129. vendor/composer/installers/src/bootstrap.php +0 -13
  130. vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php +0 -80
  131. vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php +0 -75
  132. vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +0 -114
  133. vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php +0 -83
  134. vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php +0 -90
  135. vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php +0 -63
  136. vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +0 -552
  137. vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php +0 -62
  138. vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php +0 -67
  139. vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php +0 -67
  140. vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php +0 -84
  141. vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php +0 -44
  142. vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php +0 -63
  143. vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php +0 -120
  144. vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php +0 -82
  145. vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php +0 -65
  146. vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php +0 -80
  147. vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php +0 -64
  148. vendor/composer/installers/tests/bootstrap.php +0 -4
  149. vendor/vimeo/vimeo-api/.gitattributes +0 -1
  150. vendor/vimeo/vimeo-api/.gitignore +0 -3
  151. vendor/vimeo/vimeo-api/.styleci.yml +0 -19
  152. vendor/vimeo/vimeo-api/.travis.yml +0 -21
  153. vendor/vimeo/vimeo-api/CHANGELOG.md +0 -19
  154. vendor/vimeo/vimeo-api/LICENSE +0 -177
  155. vendor/vimeo/vimeo-api/README.md +0 -254
  156. vendor/vimeo/vimeo-api/autoload.php +0 -29
  157. vendor/vimeo/vimeo-api/certificates/vimeo-api.pem +0 -47
  158. vendor/vimeo/vimeo-api/composer.json +0 -31
  159. vendor/vimeo/vimeo-api/phpunit.xml +0 -22
  160. vendor/vimeo/vimeo-api/src/Vimeo/Exceptions/ExceptionInterface.php +0 -9
  161. vendor/vimeo/vimeo-api/src/Vimeo/Exceptions/VimeoRequestException.php +0 -9
  162. vendor/vimeo/vimeo-api/src/Vimeo/Exceptions/VimeoUploadException.php +0 -9
  163. vendor/vimeo/vimeo-api/src/Vimeo/Vimeo.php +0 -598
admin/class-arve-admin-notice-factory.php CHANGED
@@ -6,7 +6,7 @@ class ARVE_Admin_Notice_Factory {
6
  private $notice;
7
  private $dismiss_forever;
8
 
9
- function __construct( $notice_id, $notice, $dismiss_forever = true, $capabilities = 'activate_plugins' ) {
10
 
11
  if ( ! current_user_can( $capabilities ) ) {
12
  return;
@@ -16,7 +16,7 @@ class ARVE_Admin_Notice_Factory {
16
  $this->notice = $notice;
17
  $this->dismiss_forever = $dismiss_forever;
18
 
19
- if ( 'admin-notice-factory-arve_dismiss_pro_notice' == $this->notice_id ) {
20
  $this->notice_id = 'arve_dismiss_pro_notice';
21
  }
22
 
@@ -24,7 +24,7 @@ class ARVE_Admin_Notice_Factory {
24
  add_action( 'wp_ajax_' . $this->notice_id, array( $this, 'ajax_call' ) );
25
  }
26
 
27
- function action_admin_notices() {
28
 
29
  if ( apply_filters( 'nj_debug_admin_message', false ) ) {
30
  delete_user_meta( get_current_user_id(), $this->notice_id );
@@ -34,24 +34,24 @@ class ARVE_Admin_Notice_Factory {
34
  $user_id = get_current_user_id();
35
  $user_meta = get_user_meta( $user_id, $this->notice_id );
36
 
37
- if( $this->dismiss_forever && ! empty( $user_meta ) ) {
38
  return;
39
- } elseif( get_transient( $this->notice_id ) ) {
40
  return;
41
  }
42
 
43
  printf(
44
  '<div class="notice is-dismissible updated" data-nj-notice-id="%s">%s</div>',
45
  esc_attr( $this->notice_id ),
46
- $this->notice
47
  );
48
  }
49
 
50
- function ajax_call() {
51
 
52
  $user_id = get_current_user_id();
53
 
54
- if( $this->dismiss_forever ) {
55
  add_user_meta( $user_id, $this->notice_id, true );
56
  } else {
57
  set_transient( $this->notice_id, true, HOUR_IN_SECONDS );
6
  private $notice;
7
  private $dismiss_forever;
8
 
9
+ public function __construct( $notice_id, $notice, $dismiss_forever = true, $capabilities = 'activate_plugins' ) {
10
 
11
  if ( ! current_user_can( $capabilities ) ) {
12
  return;
16
  $this->notice = $notice;
17
  $this->dismiss_forever = $dismiss_forever;
18
 
19
+ if ( 'admin-notice-factory-arve_dismiss_pro_notice' === $this->notice_id ) {
20
  $this->notice_id = 'arve_dismiss_pro_notice';
21
  }
22
 
24
  add_action( 'wp_ajax_' . $this->notice_id, array( $this, 'ajax_call' ) );
25
  }
26
 
27
+ public function action_admin_notices() {
28
 
29
  if ( apply_filters( 'nj_debug_admin_message', false ) ) {
30
  delete_user_meta( get_current_user_id(), $this->notice_id );
34
  $user_id = get_current_user_id();
35
  $user_meta = get_user_meta( $user_id, $this->notice_id );
36
 
37
+ if ( $this->dismiss_forever && ! empty( $user_meta ) ) {
38
  return;
39
+ } elseif ( get_transient( $this->notice_id ) ) {
40
  return;
41
  }
42
 
43
  printf(
44
  '<div class="notice is-dismissible updated" data-nj-notice-id="%s">%s</div>',
45
  esc_attr( $this->notice_id ),
46
+ $this->notice // phpcs:ignore
47
  );
48
  }
49
 
50
+ public function ajax_call() {
51
 
52
  $user_id = get_current_user_id();
53
 
54
+ if ( $this->dismiss_forever ) {
55
  add_user_meta( $user_id, $this->notice_id, true );
56
  } else {
57
  set_transient( $this->notice_id, true, HOUR_IN_SECONDS );
admin/class-nextgenthemes-plugin-updater.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
 
3
  // Exit if accessed directly
4
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -7,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
7
  * Allows plugins to use their own update API.
8
  *
9
  * @author Easy Digital Downloads
10
- * @version 1.6.17
11
  */
12
  class Nextgenthemes_Plugin_Updater {
13
 
@@ -121,6 +122,9 @@ class Nextgenthemes_Plugin_Updater {
121
 
122
  $_transient_data->response[ $this->name ] = $version_info;
123
 
 
 
 
124
  }
125
 
126
  $_transient_data->last_checked = time();
@@ -182,6 +186,14 @@ class Nextgenthemes_Plugin_Updater {
182
  $version_info->icons = $this->convert_object_to_array( $version_info->icons );
183
  }
184
 
 
 
 
 
 
 
 
 
185
  $this->set_version_info_cache( $version_info );
186
  }
187
 
@@ -316,6 +328,15 @@ class Nextgenthemes_Plugin_Updater {
316
  $_data->icons = $this->convert_object_to_array( $_data->icons );
317
  }
318
 
 
 
 
 
 
 
 
 
 
319
  return $_data;
320
  }
321
 
@@ -334,7 +355,7 @@ class Nextgenthemes_Plugin_Updater {
334
  private function convert_object_to_array( $data ) {
335
  $new_data = array();
336
  foreach ( $data as $key => $value ) {
337
- $new_data[ $key ] = $value;
338
  }
339
 
340
  return $new_data;
@@ -372,6 +393,8 @@ class Nextgenthemes_Plugin_Updater {
372
 
373
  global $wp_version, $edd_plugin_url_available;
374
 
 
 
375
  // Do a quick status check on this domain if we haven't already checked it.
376
  $store_hash = md5( $this->api_url );
377
  if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
@@ -385,7 +408,7 @@ class Nextgenthemes_Plugin_Updater {
385
  $edd_plugin_url_available[ $store_hash ] = false;
386
  } else {
387
  $test_url = $scheme . '://' . $host . $port;
388
- $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => true ) );
389
  $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
390
  }
391
  }
@@ -416,7 +439,6 @@ class Nextgenthemes_Plugin_Updater {
416
  'beta' => ! empty( $data['beta'] ),
417
  );
418
 
419
- $verify_ssl = $this->verify_ssl();
420
  $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
421
 
422
  if ( ! is_wp_error( $request ) ) {
1
  <?php
2
+ // phpcs:disable
3
 
4
  // Exit if accessed directly
5
  if ( ! defined( 'ABSPATH' ) ) exit;
8
  * Allows plugins to use their own update API.
9
  *
10
  * @author Easy Digital Downloads
11
+ * @version 1.6.19
12
  */
13
  class Nextgenthemes_Plugin_Updater {
14
 
122
 
123
  $_transient_data->response[ $this->name ] = $version_info;
124
 
125
+ // Make sure the plugin property is set to the plugin's name/location. See issue 1463 on Software Licensing's GitHub repo.
126
+ $_transient_data->response[ $this->name ]->plugin = $this->name;
127
+
128
  }
129
 
130
  $_transient_data->last_checked = time();
186
  $version_info->icons = $this->convert_object_to_array( $version_info->icons );
187
  }
188
 
189
+ if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
190
+ $version_info->icons = $this->convert_object_to_array( $version_info->icons );
191
+ }
192
+
193
+ if ( isset( $version_info->contributors ) && ! is_array( $version_info->contributors ) ) {
194
+ $version_info->contributors = $this->convert_object_to_array( $version_info->contributors );
195
+ }
196
+
197
  $this->set_version_info_cache( $version_info );
198
  }
199
 
328
  $_data->icons = $this->convert_object_to_array( $_data->icons );
329
  }
330
 
331
+ // Convert contributors into an associative array, since we're getting an object, but Core expects an array.
332
+ if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) {
333
+ $_data->contributors = $this->convert_object_to_array( $_data->contributors );
334
+ }
335
+
336
+ if( ! isset( $_data->plugin ) ) {
337
+ $_data->plugin = $this->name;
338
+ }
339
+
340
  return $_data;
341
  }
342
 
355
  private function convert_object_to_array( $data ) {
356
  $new_data = array();
357
  foreach ( $data as $key => $value ) {
358
+ $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value;
359
  }
360
 
361
  return $new_data;
393
 
394
  global $wp_version, $edd_plugin_url_available;
395
 
396
+ $verify_ssl = $this->verify_ssl();
397
+
398
  // Do a quick status check on this domain if we haven't already checked it.
399
  $store_hash = md5( $this->api_url );
400
  if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
408
  $edd_plugin_url_available[ $store_hash ] = false;
409
  } else {
410
  $test_url = $scheme . '://' . $host . $port;
411
+ $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => $verify_ssl ) );
412
  $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
413
  }
414
  }
439
  'beta' => ! empty( $data['beta'] ),
440
  );
441
 
 
442
  $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
443
 
444
  if ( ! is_wp_error( $request ) ) {
admin/functions-admin.php CHANGED
@@ -2,10 +2,10 @@
2
 
3
  function arve_action_admin_init_setup_messages() {
4
 
5
- if( defined( 'ARVE_PRO_VERSION' ) && version_compare( ARVE_PRO_VERSION_REQUIRED, ARVE_PRO_VERSION, '>' ) ) {
6
 
7
  $msg = sprintf(
8
- __( 'Your ARVE Pro Addon is outdated, you need version %s or later. If you have setup your license <a href="%s">here</a> semi auto updates (Admin panel notice and auto install on confirmation) should work again. If not please <a href="%s">report it</a> and manually update as <a href="%s">described here.</a>', ARVE_SLUG ),
9
  ARVE_PRO_VERSION_REQUIRED,
10
  get_admin_url() . 'admin.php?page=nextgenthemes-licenses',
11
  'https://nextgenthemes.com/support/',
@@ -15,7 +15,7 @@ function arve_action_admin_init_setup_messages() {
15
  new ARVE_Admin_Notice_Factory( 'arve-pro-outdated', "<p>$msg</p>", false );
16
  }
17
 
18
- if( arve_display_pro_ad() ) {
19
 
20
  $pro_ad_message = __( '<p>Hi, this is Nico(las Jonas) the author of the ARVE - Advanced Responsive Video Embedder plugin. If you are interrested in additional features and/or want to support the work I do on this plugin please consider buying the Pro Addon.</p>', ARVE_SLUG );
21
 
@@ -43,6 +43,7 @@ function arve_display_pro_ad() {
43
 
44
  function arve_widget_text() {
45
 
 
46
  printf( '<big><strong><a href="%s">Hiring a Marketing Person</a></strong></big>', 'https://nextgenthemes.com/hiring-a-marketing-person/' );
47
 
48
  echo '<p>';
@@ -58,7 +59,7 @@ function arve_widget_text() {
58
 
59
  function arve_add_dashboard_widget() {
60
 
61
- if( ! arve_display_pro_ad() ) {
62
  return false;
63
  }
64
 
@@ -68,10 +69,12 @@ function arve_add_dashboard_widget() {
68
  'arve_widget_text' // Display function.
69
  );
70
 
 
 
71
  // Globalize the metaboxes array, this holds all the widgets for wp-admin.
72
  global $wp_meta_boxes, $pagenow;
73
 
74
- if( 'index.php' == $pagenow ) {
75
  // Get the regular dashboard widgets array.
76
  // (which has our new widget already but at the end).
77
  $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
@@ -86,6 +89,7 @@ function arve_add_dashboard_widget() {
86
  // Save the sorted array back into the original metaboxes.
87
  $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
88
  }
 
89
  }
90
 
91
  /**
@@ -105,18 +109,6 @@ function arve_add_plugin_admin_menu() {
105
  }
106
  );
107
 
108
- /*
109
- add_menu_page(
110
- __( 'Advanced Responsive Video Embedder Settings', ARVE_SLUG ), # Page Title
111
- __( 'ARVE', ARVE_SLUG ), # Menu Tile
112
- 'manage_options', # capability
113
- ARVE_SLUG, # menu-slug
114
- null, # function
115
- 'dashicons-video-alt3', # icon_url
116
- '65.892' # position
117
- );
118
- */
119
-
120
  add_submenu_page(
121
  'nextgenthemes', # parent_slug
122
  __( 'Advanced Responsive Video Embedder Settings', ARVE_SLUG ), # Page Title
@@ -133,7 +125,7 @@ function arve_add_plugin_admin_menu() {
133
  */
134
  function arve_add_action_links( $links ) {
135
 
136
- if( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
137
 
138
  $extra_links['buy_pro_addon'] = sprintf(
139
  '<a href="%s"><strong style="display: inline;">%s</strong></a>',
@@ -181,13 +173,13 @@ function arve_register_shortcode_ui() {
181
 
182
  $attrs = arve_get_settings_definitions();
183
 
184
- if( function_exists( 'arve_pro_get_settings_definitions' ) ) {
185
  $attrs = array_merge( $attrs, arve_pro_get_settings_definitions() );
186
  }
187
 
188
  foreach ( $attrs as $key => $values ) {
189
 
190
- if( isset( $values['hide_from_sc'] ) && $values['hide_from_sc'] ) {
191
  continue;
192
  }
193
 
@@ -203,30 +195,16 @@ function arve_register_shortcode_ui() {
203
  )
204
  );
205
 
206
- /*
207
-
208
- foreach ($options['shortcodes'] as $sc_id => $sc) {
209
-
210
- shortcode_ui_register_for_shortcode(
211
- $sc_id,
212
- array(
213
- 'label' => esc_html( ucfirst("$sc_id ") ) . esc_html__( '(arve)', ARVE_SLUG),
214
- 'listItemImage' => 'dashicons-format-video',
215
- 'attrs' => $sc_attrs,
216
- )
217
- );
218
- }
219
- */
220
  }
221
 
222
  function arve_input( $args ) {
223
 
224
  $out = sprintf( '<input%s>', arve_attr( $args['input_attr'] ) );
225
 
226
- if ( ! empty( $args['option_values']['attr'] ) && 'thumbnail_fallback' == $args['option_values']['attr'] ) {
227
 
228
  // jQuery
229
- wp_enqueue_script('jquery');
230
  // This will enqueue the Media Uploader script
231
  wp_enqueue_media();
232
 
@@ -238,7 +216,7 @@ function arve_input( $args ) {
238
  'class' => 'button-secondary',
239
  )
240
  ),
241
- __('Upload Image', ARVE_SLUG )
242
  );
243
  }
244
 
@@ -317,7 +295,7 @@ function arve_register_settings() {
317
  ARVE_SLUG
318
  );
319
 
320
- foreach( arve_get_settings_definitions() as $key => $value ) {
321
 
322
  if ( ! empty( $value['hide_from_settings'] ) ) {
323
  continue;
@@ -331,7 +309,7 @@ function arve_register_settings() {
331
  unset( $value['options'][''] );
332
  }
333
 
334
- if( in_array( $value['type'], array( 'text', 'number', 'url' ) ) ) {
335
  $callback_function = 'arve_input';
336
  } else {
337
  $callback_function = 'arve_' . $value['type'];
@@ -344,12 +322,12 @@ function arve_register_settings() {
344
  ARVE_SLUG, // page
345
  'main_section', // section
346
  array( // args
347
- 'label_for' => ( 'radio' === $value['type'] ) ? null : "arve_options_main[{$value['attr']}]",
348
- 'input_attr' => $value['meta'] + array(
349
- 'type' => $value['type'],
350
- 'value' => $options[ $value['attr'] ],
351
- 'id' => "arve_options_main[{$value['attr']}]",
352
- 'name' => "arve_options_main[{$value['attr']}]",
353
  ),
354
  'description' => ! empty( $value['description'] ) ? $value['description'] : null,
355
  'option_values' => $value,
@@ -360,7 +338,7 @@ function arve_register_settings() {
360
  add_settings_field(
361
  'arve_options_main[reset]',
362
  null,
363
- "arve_submit_reset",
364
  ARVE_SLUG,
365
  'main_section',
366
  array(
@@ -382,18 +360,18 @@ function arve_register_settings() {
382
 
383
  add_settings_field(
384
  "arve_options_params[$provider]",
385
- ucfirst ( $provider ),
386
  'arve_input',
387
  ARVE_SLUG,
388
  'params_section',
389
  array(
390
- 'label_for' => "arve_options_params[$provider]",
391
- 'input_attr' => array(
392
- 'type' => 'text',
393
- 'value' => $params,
394
- 'id' => "arve_options_params[$provider]",
395
- 'name' => "arve_options_params[$provider]",
396
- 'class' => 'large-text'
397
  ),
398
  )
399
  );
@@ -424,18 +402,18 @@ function arve_register_settings() {
424
 
425
  add_settings_field(
426
  "arve_options_shortcodes[$provider]",
427
- ucfirst ( $provider ),
428
  'arve_input',
429
  ARVE_SLUG,
430
  'shortcodes_section',
431
  array(
432
- 'label_for' => "arve_options_shortcodes[$provider]",
433
- 'input_attr' => array(
434
- 'type' => 'text',
435
- 'value' => $shortcode,
436
- 'id' => "arve_options_shortcodes[$provider]",
437
- 'name' => "arve_options_shortcodes[$provider]",
438
- 'class' => 'medium-text'
439
  ),
440
  )
441
  );
@@ -452,7 +430,6 @@ function arve_register_settings() {
452
  )
453
  );
454
 
455
- // register_setting( $option_group, $option_name, $sanitize_callback )
456
  register_setting( 'arve-settings-group', 'arve_options_main', 'arve_validate_options_main' );
457
  register_setting( 'arve-settings-group', 'arve_options_params', 'arve_validate_options_params' );
458
  register_setting( 'arve-settings-group', 'arve_options_shortcodes', 'arve_validate_options_shortcodes' );
@@ -478,9 +455,9 @@ function arve_register_settings_debug() {
478
 
479
  function arve_submit_reset( $args ) {
480
 
481
- submit_button( __('Save Changes' ), 'primary','submit', false );
482
  echo '&nbsp;&nbsp;';
483
- submit_button( __('Reset This Settings Section', ARVE_SLUG ), 'secondary', $args['reset_name'], false );
484
  }
485
 
486
  function arve_shortcodes_section_description() {
@@ -491,8 +468,10 @@ function arve_shortcodes_section_description() {
491
  function arve_params_section_description() {
492
 
493
  $desc = sprintf(
494
- __( 'This parameters will be added to the <code>iframe src</code> urls, you can control the video players behavior with them. Please read <a href="%s" target="_blank">the documentation</a> on.',
495
- ARVE_SLUG ),
 
 
496
  esc_url( 'https://nextgenthemes.com/arve/documentation' )
497
  );
498
 
@@ -513,14 +492,14 @@ function arve_get_plugin_version_and_status( $folder_and_filename ) {
513
 
514
  $file = WP_PLUGIN_DIR . '/' . $folder_and_filename;
515
 
516
- if( ! is_file( $file ) ) {
517
  return 'NOT INSTALLED';
518
  }
519
 
520
  $data = get_plugin_data( $file );
521
  $out = $data['Version'];
522
 
523
- if( ! is_plugin_active( $folder_and_filename ) ) {
524
  $out .= ' INACTIVE';
525
  }
526
 
@@ -535,17 +514,17 @@ function arve_debug_section_description() {
535
  $arve_version = arve_get_plugin_version_and_status( 'advanced-responsive-video-embedder/advanced-responsive-video-embedder.php' );
536
  $arve_pro_version = arve_get_plugin_version_and_status( 'arve-pro/arve-pro.php' );
537
 
538
- if( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
539
  $pro_options_dump = '';
540
  } else {
541
  $pro_options = get_option( 'arve_options_pro' );
542
  unset( $pro_options['key'] );
543
  ob_start();
544
- var_dump( $pro_options );
545
  $pro_options_dump = ob_get_clean();
546
  }
547
 
548
- include_once( plugin_dir_path( __FILE__ ) . 'html-debug-info.php' );
549
  }
550
 
551
  /**
@@ -556,7 +535,7 @@ function arve_debug_section_description() {
556
  function arve_validate_options_main( $input ) {
557
 
558
  // Storing the Options Section as a empty array will cause the plugin to use defaults
559
- if( isset( $input['reset'] ) ) {
560
  return array();
561
  }
562
 
@@ -566,22 +545,22 @@ function arve_validate_options_main( $input ) {
566
  $output['controlslist'] = sanitize_text_field( $input['controlslist'] );
567
  $output['vimeo_api_token'] = sanitize_text_field( $input['vimeo_api_token'] );
568
 
569
- $output['always_enqueue_assets'] = ( 'yes' == $input['always_enqueue_assets'] ) ? true : false;
570
- $output['autoplay'] = ( 'yes' == $input['autoplay'] ) ? true : false;
571
- $output['promote_link'] = ( 'yes' == $input['promote_link'] ) ? true : false;
572
- $output['wp_video_override'] = ( 'yes' == $input['wp_video_override'] ) ? true : false;
573
- $output['youtube_nocookie'] = ( 'yes' == $input['youtube_nocookie'] ) ? true : false;
574
 
575
  $output['wp_image_cache_time'] = (int) $input['wp_image_cache_time'];
576
 
577
- if( (int) $input['video_maxwidth'] > 100 ) {
578
- $output['video_maxwidth'] = (int) $input['video_maxwidth'];
579
  } else {
580
- $output['video_maxwidth'] = '';
581
  }
582
 
583
- if( (int) $input['align_maxwidth'] > 100 ) {
584
- $output['align_maxwidth'] = (int) $input['align_maxwidth'];
585
  }
586
 
587
  $options_defaults = arve_get_options_defaults( 'main' );
@@ -592,7 +571,7 @@ function arve_validate_options_main( $input ) {
592
  function arve_validate_options_params( $input ) {
593
 
594
  // Storing the Options Section as a empty array will cause the plugin to use defaults
595
- if( isset( $input['reset'] ) ) {
596
  return array();
597
  }
598
 
@@ -613,16 +592,16 @@ function arve_validate_options_shortcodes( $input ) {
613
  $output = array();
614
 
615
  //* Storing the Options Section as a empty array will cause the plugin to use defaults
616
- if( isset( $input['reset'] ) ) {
617
  return array();
618
  }
619
 
620
  foreach ( $input as $key => $var ) {
621
 
622
- $var = preg_replace( '/[_]+/', '_', $var ); // remove multiple underscores
623
- $var = preg_replace( '/[^A-Za-z0-9_]/', '', $var ); // strip away everything except a-z,0-9 and underscores
624
 
625
- if ( strlen($var) < 3 ) {
626
  continue;
627
  }
628
 
2
 
3
  function arve_action_admin_init_setup_messages() {
4
 
5
+ if ( defined( 'ARVE_PRO_VERSION' ) && version_compare( ARVE_PRO_VERSION_REQUIRED, ARVE_PRO_VERSION, '>' ) ) {
6
 
7
  $msg = sprintf(
8
+ __( 'Your ARVE Pro Addon is outdated, you need version %1$s or later. If you have setup your license <a href="%2$s">here</a> semi auto updates (Admin panel notice and auto install on confirmation) should work again. If not please <a href="%3$s">report it</a> and manually update as <a href="%4$s">described here.</a>', ARVE_SLUG ),
9
  ARVE_PRO_VERSION_REQUIRED,
10
  get_admin_url() . 'admin.php?page=nextgenthemes-licenses',
11
  'https://nextgenthemes.com/support/',
15
  new ARVE_Admin_Notice_Factory( 'arve-pro-outdated', "<p>$msg</p>", false );
16
  }
17
 
18
+ if ( arve_display_pro_ad() ) {
19
 
20
  $pro_ad_message = __( '<p>Hi, this is Nico(las Jonas) the author of the ARVE - Advanced Responsive Video Embedder plugin. If you are interrested in additional features and/or want to support the work I do on this plugin please consider buying the Pro Addon.</p>', ARVE_SLUG );
21
 
43
 
44
  function arve_widget_text() {
45
 
46
+ // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
47
  printf( '<big><strong><a href="%s">Hiring a Marketing Person</a></strong></big>', 'https://nextgenthemes.com/hiring-a-marketing-person/' );
48
 
49
  echo '<p>';
59
 
60
  function arve_add_dashboard_widget() {
61
 
62
+ if ( ! arve_display_pro_ad() ) {
63
  return false;
64
  }
65
 
69
  'arve_widget_text' // Display function.
70
  );
71
 
72
+ // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
73
+
74
  // Globalize the metaboxes array, this holds all the widgets for wp-admin.
75
  global $wp_meta_boxes, $pagenow;
76
 
77
+ if ( 'index.php' === $pagenow ) {
78
  // Get the regular dashboard widgets array.
79
  // (which has our new widget already but at the end).
80
  $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
89
  // Save the sorted array back into the original metaboxes.
90
  $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
91
  }
92
+ // phpcs:enable WordPress.WP.GlobalVariablesOverride.Prohibited
93
  }
94
 
95
  /**
109
  }
110
  );
111
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  add_submenu_page(
113
  'nextgenthemes', # parent_slug
114
  __( 'Advanced Responsive Video Embedder Settings', ARVE_SLUG ), # Page Title
125
  */
126
  function arve_add_action_links( $links ) {
127
 
128
+ if ( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
129
 
130
  $extra_links['buy_pro_addon'] = sprintf(
131
  '<a href="%s"><strong style="display: inline;">%s</strong></a>',
173
 
174
  $attrs = arve_get_settings_definitions();
175
 
176
+ if ( function_exists( 'arve_pro_get_settings_definitions' ) ) {
177
  $attrs = array_merge( $attrs, arve_pro_get_settings_definitions() );
178
  }
179
 
180
  foreach ( $attrs as $key => $values ) {
181
 
182
+ if ( isset( $values['hide_from_sc'] ) && $values['hide_from_sc'] ) {
183
  continue;
184
  }
185
 
195
  )
196
  );
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
199
 
200
  function arve_input( $args ) {
201
 
202
  $out = sprintf( '<input%s>', arve_attr( $args['input_attr'] ) );
203
 
204
+ if ( ! empty( $args['option_values']['attr'] ) && 'thumbnail_fallback' === $args['option_values']['attr'] ) {
205
 
206
  // jQuery
207
+ wp_enqueue_script( 'jquery' );
208
  // This will enqueue the Media Uploader script
209
  wp_enqueue_media();
210
 
216
  'class' => 'button-secondary',
217
  )
218
  ),
219
+ __( 'Upload Image', ARVE_SLUG )
220
  );
221
  }
222
 
295
  ARVE_SLUG
296
  );
297
 
298
+ foreach ( arve_get_settings_definitions() as $key => $value ) {
299
 
300
  if ( ! empty( $value['hide_from_settings'] ) ) {
301
  continue;
309
  unset( $value['options'][''] );
310
  }
311
 
312
+ if ( in_array( $value['type'], array( 'text', 'number', 'url' ), true ) ) {
313
  $callback_function = 'arve_input';
314
  } else {
315
  $callback_function = 'arve_' . $value['type'];
322
  ARVE_SLUG, // page
323
  'main_section', // section
324
  array( // args
325
+ 'label_for' => ( 'radio' === $value['type'] ) ? null : "arve_options_main[{$value['attr']}]",
326
+ 'input_attr' => $value['meta'] + array(
327
+ 'type' => $value['type'],
328
+ 'value' => $options[ $value['attr'] ],
329
+ 'id' => "arve_options_main[{$value['attr']}]",
330
+ 'name' => "arve_options_main[{$value['attr']}]",
331
  ),
332
  'description' => ! empty( $value['description'] ) ? $value['description'] : null,
333
  'option_values' => $value,
338
  add_settings_field(
339
  'arve_options_main[reset]',
340
  null,
341
+ 'arve_submit_reset',
342
  ARVE_SLUG,
343
  'main_section',
344
  array(
360
 
361
  add_settings_field(
362
  "arve_options_params[$provider]",
363
+ ucfirst( $provider ),
364
  'arve_input',
365
  ARVE_SLUG,
366
  'params_section',
367
  array(
368
+ 'label_for' => "arve_options_params[$provider]",
369
+ 'input_attr' => array(
370
+ 'type' => 'text',
371
+ 'value' => $params,
372
+ 'id' => "arve_options_params[$provider]",
373
+ 'name' => "arve_options_params[$provider]",
374
+ 'class' => 'large-text'
375
  ),
376
  )
377
  );
402
 
403
  add_settings_field(
404
  "arve_options_shortcodes[$provider]",
405
+ ucfirst( $provider ),
406
  'arve_input',
407
  ARVE_SLUG,
408
  'shortcodes_section',
409
  array(
410
+ 'label_for' => "arve_options_shortcodes[$provider]",
411
+ 'input_attr' => array(
412
+ 'type' => 'text',
413
+ 'value' => $shortcode,
414
+ 'id' => "arve_options_shortcodes[$provider]",
415
+ 'name' => "arve_options_shortcodes[$provider]",
416
+ 'class' => 'medium-text'
417
  ),
418
  )
419
  );
430
  )
431
  );
432
 
 
433
  register_setting( 'arve-settings-group', 'arve_options_main', 'arve_validate_options_main' );
434
  register_setting( 'arve-settings-group', 'arve_options_params', 'arve_validate_options_params' );
435
  register_setting( 'arve-settings-group', 'arve_options_shortcodes', 'arve_validate_options_shortcodes' );
455
 
456
  function arve_submit_reset( $args ) {
457
 
458
+ submit_button( __( 'Save Changes', ARVE_SLUG ), 'primary', 'submit', false );
459
  echo '&nbsp;&nbsp;';
460
+ submit_button( __( 'Reset This Settings Section', ARVE_SLUG ), 'secondary', $args['reset_name'], false );
461
  }
462
 
463
  function arve_shortcodes_section_description() {
468
  function arve_params_section_description() {
469
 
470
  $desc = sprintf(
471
+ __(
472
+ 'This parameters will be added to the <code>iframe src</code> urls, you can control the video players behavior with them. Please read <a href="%s" target="_blank">the documentation</a> on.',
473
+ ARVE_SLUG
474
+ ),
475
  esc_url( 'https://nextgenthemes.com/arve/documentation' )
476
  );
477
 
492
 
493
  $file = WP_PLUGIN_DIR . '/' . $folder_and_filename;
494
 
495
+ if ( ! is_file( $file ) ) {
496
  return 'NOT INSTALLED';
497
  }
498
 
499
  $data = get_plugin_data( $file );
500
  $out = $data['Version'];
501
 
502
+ if ( ! is_plugin_active( $folder_and_filename ) ) {
503
  $out .= ' INACTIVE';
504
  }
505
 
514
  $arve_version = arve_get_plugin_version_and_status( 'advanced-responsive-video-embedder/advanced-responsive-video-embedder.php' );
515
  $arve_pro_version = arve_get_plugin_version_and_status( 'arve-pro/arve-pro.php' );
516
 
517
+ if ( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
518
  $pro_options_dump = '';
519
  } else {
520
  $pro_options = get_option( 'arve_options_pro' );
521
  unset( $pro_options['key'] );
522
  ob_start();
523
+ var_dump( $pro_options ); // phpcs:ignore
524
  $pro_options_dump = ob_get_clean();
525
  }
526
 
527
+ include_once plugin_dir_path( __FILE__ ) . 'html-debug-info.php';
528
  }
529
 
530
  /**
535
  function arve_validate_options_main( $input ) {
536
 
537
  // Storing the Options Section as a empty array will cause the plugin to use defaults
538
+ if ( isset( $input['reset'] ) ) {
539
  return array();
540
  }
541
 
545
  $output['controlslist'] = sanitize_text_field( $input['controlslist'] );
546
  $output['vimeo_api_token'] = sanitize_text_field( $input['vimeo_api_token'] );
547
 
548
+ $output['always_enqueue_assets'] = ( 'yes' === $input['always_enqueue_assets'] ) ? true : false;
549
+ $output['autoplay'] = ( 'yes' === $input['autoplay'] ) ? true : false;
550
+ $output['promote_link'] = ( 'yes' === $input['promote_link'] ) ? true : false;
551
+ $output['wp_video_override'] = ( 'yes' === $input['wp_video_override'] ) ? true : false;
552
+ $output['youtube_nocookie'] = ( 'yes' === $input['youtube_nocookie'] ) ? true : false;
553
 
554
  $output['wp_image_cache_time'] = (int) $input['wp_image_cache_time'];
555
 
556
+ if ( (int) $input['video_maxwidth'] > 100 ) {
557
+ $output['video_maxwidth'] = (int) $input['video_maxwidth'];
558
  } else {
559
+ $output['video_maxwidth'] = '';
560
  }
561
 
562
+ if ( (int) $input['align_maxwidth'] > 100 ) {
563
+ $output['align_maxwidth'] = (int) $input['align_maxwidth'];
564
  }
565
 
566
  $options_defaults = arve_get_options_defaults( 'main' );
571
  function arve_validate_options_params( $input ) {
572
 
573
  // Storing the Options Section as a empty array will cause the plugin to use defaults
574
+ if ( isset( $input['reset'] ) ) {
575
  return array();
576
  }
577
 
592
  $output = array();
593
 
594
  //* Storing the Options Section as a empty array will cause the plugin to use defaults
595
+ if ( isset( $input['reset'] ) ) {
596
  return array();
597
  }
598
 
599
  foreach ( $input as $key => $var ) {
600
 
601
+ $var = preg_replace( '/[_]+/', '_', $var ); // remove multiple underscores
602
+ $var = preg_replace( '/[^A-Za-z0-9_]/', '', $var ); // strip away everything except a-z,0-9 and underscores
603
 
604
+ if ( strlen( $var ) < 3 ) {
605
  continue;
606
  }
607
 
admin/functions-licensing.php CHANGED
@@ -110,7 +110,12 @@ function nextgenthemes_ads_page() { ?>
110
  margin: 1rem;
111
  }
112
  </style>
113
- <?php $img_dir = plugin_dir_url( __FILE__ ) . 'product-images/'; ?>
 
 
 
 
 
114
  <div id="nextgenthemes-ads">
115
 
116
  <?php if ( ! defined( 'ARVE_PRO_VERSION' ) ) : ?>
@@ -139,7 +144,7 @@ function nextgenthemes_ads_page() { ?>
139
 
140
  </div>
141
 
142
- <?php
143
  }
144
 
145
  function nextgenthemes_feature_list_html( $filepath ) {
@@ -152,10 +157,10 @@ function nextgenthemes_activation_notices() {
152
 
153
  foreach ( $products as $key => $value ) {
154
 
155
- if( $value['active'] && ! $value['valid_key'] ) {
156
 
157
  $msg = sprintf(
158
- __( 'Hi there, thanks for your purchase. One last step, please activate your %s <a href="%s">here now</a>.', ARVE_SLUG ),
159
  $value['name'],
160
  get_admin_url() . 'admin.php?page=nextgenthemes-licenses'
161
  );
@@ -167,14 +172,14 @@ function nextgenthemes_activation_notices() {
167
  function nextgenthemes_get_products() {
168
 
169
  $products = array(
170
- 'arve_pro' => array(
171
- 'name' => 'ARVE Pro',
172
- 'id' => 1253,
173
- 'type' => 'plugin',
174
- 'author' => 'Nicolas Jonas',
175
- 'url' => 'https://nextgenthemes.com/plugins/arve-pro/',
176
  ),
177
- 'arve_amp' => array(
178
  'name' => 'ARVE AMP',
179
  'id' => 16941,
180
  'type' => 'plugin',
@@ -202,20 +207,20 @@ function nextgenthemes_get_products() {
202
  $version_define = strtoupper( $key ) . '_VERSION';
203
  $file_define = strtoupper( $key ) . '_FILE';
204
 
205
- if( defined( $version_define ) ) {
206
  $products[ $key ]['version'] = constant( $version_define );
207
  }
208
- if( defined( $file_define ) ) {
209
  $products[ $key ]['file'] = constant( $file_define );
210
  }
211
 
212
  $version_define = "\\nextgenthemes\\$key\\VERSION";
213
  $file_define = "\\nextgenthemes\\$key\\FILE";
214
 
215
- if( defined( $version_define ) ) {
216
  $products[ $key ]['version'] = constant( $version_define );
217
  }
218
- if( defined( $file_define ) ) {
219
  $products[ $key ]['file'] = constant( $file_define );
220
  }
221
 
@@ -235,7 +240,7 @@ function nextgenthemes_is_plugin_installed( $plugin_basename ) {
235
 
236
  $plugins = get_plugins();
237
 
238
- if( array_key_exists( $plugin_basename, $plugins ) ) {
239
  return true;
240
  } else {
241
  return false;
@@ -305,12 +310,17 @@ function nextgenthemes_key_callback( $args ) {
305
 
306
  echo '<p>';
307
 
308
- printf( '<input%s>', arve_attr( array(
309
- 'type' => 'hidden',
310
- 'id' => $args['option_basename'] . '[product]',
311
- 'name' => $args['option_basename'] . '[product]',
312
- 'value' => $args['product']['slug'],
313
- ) ) );
 
 
 
 
 
314
 
315
  printf(
316
  '<input%s%s>',
@@ -319,50 +329,54 @@ function nextgenthemes_key_callback( $args ) {
319
  );
320
 
321
  $defined_key = nextgenthemes_get_defined_key( $args['product']['slug'] );
322
- $key = nextgenthemes_get_key( $args['product']['slug'] );
323
 
324
- if( $defined_key || ! empty( $key ) ) {
325
 
326
- submit_button( __('Activate License', ARVE_SLUG ), 'primary', $args['option_basename'] . '[activate_key]', false );
327
- submit_button( __('Deactivate License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[deactivate_key]', false );
328
- submit_button( __('Check License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[check_key]', false );
329
- }
330
  echo '</p>';
331
 
332
- echo '<p>';
333
- echo __( 'License Status: ', ARVE_SLUG ) . nextgenthemes_get_key_status( $args['product']['slug'] );
334
- echo '</p>';
335
 
336
- if( $args['product']['installed'] && ! $args['product']['active'] ) {
337
  printf( '<strong>%s</strong>', __( 'Plugin is installed but not activated', ARVE_SLUG ) );
338
- } elseif( ! $args['product']['active'] ) {
339
- printf(
340
  '<a%s>%s</a>',
341
- arve_attr( array(
342
- 'href' => $args['product']['url'],
343
- 'class' => 'button button-primary',
344
- ) ),
 
 
345
  __( 'Not installed, check it out', ARVE_SLUG )
346
  );
347
- }
348
  }
349
 
350
  function nextgenthemes_validate_license( $input ) {
351
 
352
- if( ! is_array( $input ) ) {
353
  return sanitize_text_field( $input );
354
  }
355
 
356
- $product = $input['product'];
 
357
 
358
- if ( $defined_key = nextgenthemes_get_defined_key( $product ) ) {
359
- $option_key = $key = $defined_key;
 
360
  } else {
361
  $key = sanitize_text_field( $input['key'] );
362
  $option_key = nextgenthemes_get_key( $product );
363
  }
364
 
365
- if( ( $key != $option_key ) || isset( $input['activate_key'] ) ) {
366
 
367
  nextgenthemes_api_update_key_status( $product, $key, 'activate' );
368
 
@@ -380,7 +394,9 @@ function nextgenthemes_validate_license( $input ) {
380
 
381
  function nextgenthemes_get_key( $product, $option_only = false ) {
382
 
383
- if( ! $option_only && $defined_key = nextgenthemes_get_defined_key( $product ) ) {
 
 
384
  return $defined_key;
385
  }
386
 
@@ -408,7 +424,7 @@ function nextgenthemes_get_defined_key( $slug ) {
408
 
409
  $constant_name = str_replace( '-', '_', strtoupper( $slug . '_KEY' ) );
410
 
411
- if( defined( $constant_name ) && constant( $constant_name ) ) {
412
  return constant( $constant_name );
413
  } else {
414
  return false;
@@ -416,10 +432,10 @@ function nextgenthemes_get_defined_key( $slug ) {
416
  }
417
 
418
  function nextgenthemes_licenses_page() {
419
- ?>
420
  <div class="wrap">
421
 
422
- <h2><?php esc_html_e( get_admin_page_title() ); ?></h2>
423
 
424
  <form method="post" action="options.php">
425
 
@@ -429,7 +445,7 @@ function nextgenthemes_licenses_page() {
429
  </form>
430
 
431
  </div>
432
- <?php
433
  }
434
 
435
  function nextgenthemes_init_edd_updaters() {
@@ -438,9 +454,9 @@ function nextgenthemes_init_edd_updaters() {
438
 
439
  foreach ( $products as $product ) {
440
 
441
- if ( 'plugin' == $product['type'] && ! empty( $product['file'] ) ) {
442
  nextgenthemes_init_plugin_updater( $product );
443
- } elseif ( 'theme' == $product['type'] ) {
444
  nextgenthemes_init_theme_updater( $product );
445
  }
446
  }
@@ -453,10 +469,10 @@ function nextgenthemes_init_plugin_updater( $product ) {
453
  apply_filters( 'nextgenthemes_api_url', 'https://nextgenthemes.com' ),
454
  $product['file'],
455
  array(
456
- 'version' => $product['version'],
457
- 'license' => nextgenthemes_get_key( $product['slug'] ),
458
- 'item_id' => $product['id'],
459
- 'author' => $product['author']
460
  )
461
  );
462
  }
@@ -496,14 +512,14 @@ function nextgenthemes_init_theme_updater( $product ) {
496
  'site-is-inactive' => __( 'Site is inactive.', ARVE_SLUG ),
497
  'license-status-unknown' => __( 'License status is unknown.', ARVE_SLUG ),
498
  'update-notice' => __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.", ARVE_SLUG ),
499
- 'update-available' => __('<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.', ARVE_SLUG ),
500
  )
501
  );
502
  }
503
 
504
  function nextgenthemes_api_action( $item_id, $key, $action ) {
505
 
506
- if ( ! in_array( $action, array( 'activate', 'deactivate', 'check' ) ) ) {
507
  wp_die( 'invalid action' );
508
  }
509
 
@@ -518,7 +534,11 @@ function nextgenthemes_api_action( $item_id, $key, $action ) {
518
  // Call the custom API.
519
  $response = wp_remote_post(
520
  'https://nextgenthemes.com',
521
- array( 'timeout' => 15, 'sslverify' => true, 'body' => $api_params )
 
 
 
 
522
  );
523
 
524
  // make sure the response came back okay
@@ -529,51 +549,43 @@ function nextgenthemes_api_action( $item_id, $key, $action ) {
529
  } else {
530
  $message = __( 'An error occurred, please try again.', ARVE_SLUG );
531
  }
532
-
533
  } else {
534
 
535
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
536
 
537
  if ( false === $license_data->success ) {
538
 
539
- switch( $license_data->error ) {
540
-
541
- case 'expired' :
542
 
 
543
  $message = sprintf(
544
  __( 'Your license key expired on %s.' ),
545
  date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
546
  );
547
  break;
548
 
549
- case 'revoked' :
550
-
551
  $message = __( 'Your license key has been disabled.', ARVE_SLUG );
552
  break;
553
 
554
- case 'missing' :
555
-
556
  $message = __( 'Invalid license.', ARVE_SLUG );
557
  break;
558
 
559
- case 'invalid' :
560
- case 'site_inactive' :
561
-
562
  $message = __( 'Your license is not active for this URL.', ARVE_SLUG );
563
  break;
564
 
565
- case 'item_name_mismatch' :
566
-
567
  $message = sprintf( __( 'This appears to be an invalid license key for %s.' ), ARVE_SLUG );
568
  break;
569
 
570
  case 'no_activations_left':
571
-
572
  $message = __( 'Your license key has reached its activation limit.', ARVE_SLUG );
573
  break;
574
 
575
- default :
576
-
577
  $message = __( 'An error occurred, please try again.', ARVE_SLUG );
578
  break;
579
  }
@@ -600,7 +612,7 @@ function nextgenthemes_api_action( $item_id, $key, $action ) {
600
 
601
  function arve_dump( $var ) {
602
  ob_start();
603
- var_dump( $var );
604
  return ob_get_clean();
605
  }
606
 
110
  margin: 1rem;
111
  }
112
  </style>
113
+
114
+ <?php
115
+ $img_dir = plugin_dir_url( __FILE__ ) . 'product-images/';
116
+ // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
117
+ ?>
118
+
119
  <div id="nextgenthemes-ads">
120
 
121
  <?php if ( ! defined( 'ARVE_PRO_VERSION' ) ) : ?>
144
 
145
  </div>
146
 
147
+ <?php
148
  }
149
 
150
  function nextgenthemes_feature_list_html( $filepath ) {
157
 
158
  foreach ( $products as $key => $value ) {
159
 
160
+ if ( $value['active'] && ! $value['valid_key'] ) {
161
 
162
  $msg = sprintf(
163
+ __( 'Hi there, thanks for your purchase. One last step, please activate your %1$s <a href="%2$s">here now</a>.', ARVE_SLUG ),
164
  $value['name'],
165
  get_admin_url() . 'admin.php?page=nextgenthemes-licenses'
166
  );
172
  function nextgenthemes_get_products() {
173
 
174
  $products = array(
175
+ 'arve_pro' => array(
176
+ 'name' => 'ARVE Pro',
177
+ 'id' => 1253,
178
+ 'type' => 'plugin',
179
+ 'author' => 'Nicolas Jonas',
180
+ 'url' => 'https://nextgenthemes.com/plugins/arve-pro/',
181
  ),
182
+ 'arve_amp' => array(
183
  'name' => 'ARVE AMP',
184
  'id' => 16941,
185
  'type' => 'plugin',
207
  $version_define = strtoupper( $key ) . '_VERSION';
208
  $file_define = strtoupper( $key ) . '_FILE';
209
 
210
+ if ( defined( $version_define ) ) {
211
  $products[ $key ]['version'] = constant( $version_define );
212
  }
213
+ if ( defined( $file_define ) ) {
214
  $products[ $key ]['file'] = constant( $file_define );
215
  }
216
 
217
  $version_define = "\\nextgenthemes\\$key\\VERSION";
218
  $file_define = "\\nextgenthemes\\$key\\FILE";
219
 
220
+ if ( defined( $version_define ) ) {
221
  $products[ $key ]['version'] = constant( $version_define );
222
  }
223
+ if ( defined( $file_define ) ) {
224
  $products[ $key ]['file'] = constant( $file_define );
225
  }
226
 
240
 
241
  $plugins = get_plugins();
242
 
243
+ if ( array_key_exists( $plugin_basename, $plugins ) ) {
244
  return true;
245
  } else {
246
  return false;
310
 
311
  echo '<p>';
312
 
313
+ printf(
314
+ '<input%s>',
315
+ arve_attr(
316
+ array(
317
+ 'type' => 'hidden',
318
+ 'id' => $args['option_basename'] . '[product]',
319
+ 'name' => $args['option_basename'] . '[product]',
320
+ 'value' => $args['product']['slug'],
321
+ )
322
+ )
323
+ );
324
 
325
  printf(
326
  '<input%s%s>',
329
  );
330
 
331
  $defined_key = nextgenthemes_get_defined_key( $args['product']['slug'] );
332
+ $key = nextgenthemes_get_key( $args['product']['slug'] );
333
 
334
+ if ( $defined_key || ! empty( $key ) ) {
335
 
336
+ submit_button( __( 'Activate License', ARVE_SLUG ), 'primary', $args['option_basename'] . '[activate_key]', false );
337
+ submit_button( __( 'Deactivate License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[deactivate_key]', false );
338
+ submit_button( __( 'Check License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[check_key]', false );
339
+ }
340
  echo '</p>';
341
 
342
+ echo '<p>';
343
+ echo __( 'License Status: ', ARVE_SLUG ) . nextgenthemes_get_key_status( $args['product']['slug'] );
344
+ echo '</p>';
345
 
346
+ if ( $args['product']['installed'] && ! $args['product']['active'] ) {
347
  printf( '<strong>%s</strong>', __( 'Plugin is installed but not activated', ARVE_SLUG ) );
348
+ } elseif ( ! $args['product']['active'] ) {
349
+ printf(
350
  '<a%s>%s</a>',
351
+ arve_attr(
352
+ array(
353
+ 'href' => $args['product']['url'],
354
+ 'class' => 'button button-primary',
355
+ )
356
+ ),
357
  __( 'Not installed, check it out', ARVE_SLUG )
358
  );
359
+ }
360
  }
361
 
362
  function nextgenthemes_validate_license( $input ) {
363
 
364
+ if ( ! is_array( $input ) ) {
365
  return sanitize_text_field( $input );
366
  }
367
 
368
+ $product = $input['product'];
369
+ $defined_key = nextgenthemes_get_defined_key( $product );
370
 
371
+ if ( $defined_key ) {
372
+ $option_key = $defined_key;
373
+ $key = $defined_key;
374
  } else {
375
  $key = sanitize_text_field( $input['key'] );
376
  $option_key = nextgenthemes_get_key( $product );
377
  }
378
 
379
+ if ( ( $key !== $option_key ) || isset( $input['activate_key'] ) ) {
380
 
381
  nextgenthemes_api_update_key_status( $product, $key, 'activate' );
382
 
394
 
395
  function nextgenthemes_get_key( $product, $option_only = false ) {
396
 
397
+ $defined_key = nextgenthemes_get_defined_key( $product );
398
+
399
+ if ( ! $option_only && $defined_key ) {
400
  return $defined_key;
401
  }
402
 
424
 
425
  $constant_name = str_replace( '-', '_', strtoupper( $slug . '_KEY' ) );
426
 
427
+ if ( defined( $constant_name ) && constant( $constant_name ) ) {
428
  return constant( $constant_name );
429
  } else {
430
  return false;
432
  }
433
 
434
  function nextgenthemes_licenses_page() {
435
+ ?>
436
  <div class="wrap">
437
 
438
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
439
 
440
  <form method="post" action="options.php">
441
 
445
  </form>
446
 
447
  </div>
448
+ <?php
449
  }
450
 
451
  function nextgenthemes_init_edd_updaters() {
454
 
455
  foreach ( $products as $product ) {
456
 
457
+ if ( 'plugin' === $product['type'] && ! empty( $product['file'] ) ) {
458
  nextgenthemes_init_plugin_updater( $product );
459
+ } elseif ( 'theme' === $product['type'] ) {
460
  nextgenthemes_init_theme_updater( $product );
461
  }
462
  }
469
  apply_filters( 'nextgenthemes_api_url', 'https://nextgenthemes.com' ),
470
  $product['file'],
471
  array(
472
+ 'version' => $product['version'],
473
+ 'license' => nextgenthemes_get_key( $product['slug'] ),
474
+ 'item_id' => $product['id'],
475
+ 'author' => $product['author']
476
  )
477
  );
478
  }
512
  'site-is-inactive' => __( 'Site is inactive.', ARVE_SLUG ),
513
  'license-status-unknown' => __( 'License status is unknown.', ARVE_SLUG ),
514
  'update-notice' => __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.", ARVE_SLUG ),
515
+ 'update-available' => __( '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4$s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.', ARVE_SLUG ),
516
  )
517
  );
518
  }
519
 
520
  function nextgenthemes_api_action( $item_id, $key, $action ) {
521
 
522
+ if ( ! in_array( $action, array( 'activate', 'deactivate', 'check' ), true ) ) {
523
  wp_die( 'invalid action' );
524
  }
525
 
534
  // Call the custom API.
535
  $response = wp_remote_post(
536
  'https://nextgenthemes.com',
537
+ array(
538
+ 'timeout' => 15,
539
+ 'sslverify' => true,
540
+ 'body' => $api_params
541
+ )
542
  );
543
 
544
  // make sure the response came back okay
549
  } else {
550
  $message = __( 'An error occurred, please try again.', ARVE_SLUG );
551
  }
 
552
  } else {
553
 
554
  $license_data = json_decode( wp_remote_retrieve_body( $response ) );
555
 
556
  if ( false === $license_data->success ) {
557
 
558
+ switch ( $license_data->error ) {
 
 
559
 
560
+ case 'expired':
561
  $message = sprintf(
562
  __( 'Your license key expired on %s.' ),
563
  date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
564
  );
565
  break;
566
 
567
+ case 'revoked':
 
568
  $message = __( 'Your license key has been disabled.', ARVE_SLUG );
569
  break;
570
 
571
+ case 'missing':
 
572
  $message = __( 'Invalid license.', ARVE_SLUG );
573
  break;
574
 
575
+ case 'invalid':
576
+ case 'site_inactive':
 
577
  $message = __( 'Your license is not active for this URL.', ARVE_SLUG );
578
  break;
579
 
580
+ case 'item_name_mismatch':
 
581
  $message = sprintf( __( 'This appears to be an invalid license key for %s.' ), ARVE_SLUG );
582
  break;
583
 
584
  case 'no_activations_left':
 
585
  $message = __( 'Your license key has reached its activation limit.', ARVE_SLUG );
586
  break;
587
 
588
+ default:
 
589
  $message = __( 'An error occurred, please try again.', ARVE_SLUG );
590
  break;
591
  }
612
 
613
  function arve_dump( $var ) {
614
  ob_start();
615
+ var_dump( $var ); // phpcs:ignore
616
  return ob_get_clean();
617
  }
618
 
admin/html-debug-info.php CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  <textarea style="font-family: monospace; width: 100%" rows="25">
2
  ARVE Version: <?php echo $arve_version . "\n"; ?>
3
  ARVE-Pro Version: <?php echo $arve_pro_version . "\n"; ?>
@@ -6,12 +9,12 @@ PHP Version: <?php echo phpversion() . "\n"; ?>
6
 
7
  ACTIVE PLUGINS:
8
  <?php
9
- $plugins = get_plugins();
10
  $active_plugins = get_option( 'active_plugins', array() );
11
 
12
- foreach ( $plugins as $plugin_path => $plugin ) {
13
  // If the plugin isn't active, don't show it.
14
- if ( ! in_array( $plugin_path, $active_plugins ) ) {
15
  continue;
16
  }
17
 
@@ -19,36 +22,39 @@ foreach ( $plugins as $plugin_path => $plugin ) {
19
  }
20
 
21
  if ( is_multisite() ) :
22
- ?>
23
 
24
  NETWORK ACTIVE PLUGINS:
25
- <?php
26
- $plugins = wp_get_active_network_plugins();
27
- $active_plugins = get_site_option( 'active_sitewide_plugins', array() );
28
 
29
- foreach ( $plugins as $plugin_path ) {
30
- $plugin_base = plugin_basename( $plugin_path );
31
 
32
- // If the plugin isn't active, don't show it.
33
- if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
34
- continue;
35
- }
36
 
37
- $plugin = get_plugin_data( $plugin_path );
38
 
39
- echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
40
- }
41
 
42
- endif; ?>
 
43
 
44
  ARVE OPTIONS:
45
  <?php var_dump( get_option( 'arve_options_main' ) ); ?>
46
  <?php var_dump( get_option( 'arve_options_params' ) ); ?>
47
  <?php var_dump( get_option( 'arve_options_shortcodes' ) ); ?>
48
- <?php if( is_plugin_active( 'arve-pro/arve-pro.php' ) ) : ?>
49
  ARVE PRO OPTIONS:
50
- <?php $pro_options = get_option( 'arve_options_pro' );
51
- unset( $pro_options['key'] );
52
- var_dump( $pro_options ); ?>
 
 
53
  <?php endif; ?>
54
  </textarea>
1
+ <?php
2
+ // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.PHP.DevelopmentFunctions.error_log_var_dump
3
+ ?>
4
  <textarea style="font-family: monospace; width: 100%" rows="25">
5
  ARVE Version: <?php echo $arve_version . "\n"; ?>
6
  ARVE-Pro Version: <?php echo $arve_pro_version . "\n"; ?>
9
 
10
  ACTIVE PLUGINS:
11
  <?php
12
+ $get_plugins = get_plugins();
13
  $active_plugins = get_option( 'active_plugins', array() );
14
 
15
+ foreach ( $get_plugins as $plugin_path => $plugin ) {
16
  // If the plugin isn't active, don't show it.
17
+ if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
18
  continue;
19
  }
20
 
22
  }
23
 
24
  if ( is_multisite() ) :
25
+ ?>
26
 
27
  NETWORK ACTIVE PLUGINS:
28
+ <?php
29
+ $netw_plugins = wp_get_active_network_plugins();
30
+ $active_plugins = get_site_option( 'active_sitewide_plugins', array() );
31
 
32
+ foreach ( $netw_plugins as $plugin_path ) {
33
+ $plugin_base = plugin_basename( $plugin_path );
34
 
35
+ // If the plugin isn't active, don't show it.
36
+ if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
37
+ continue;
38
+ }
39
 
40
+ $plugin = get_plugin_data( $plugin_path );
41
 
42
+ echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
43
+ }
44
 
45
+ endif;
46
+ ?>
47
 
48
  ARVE OPTIONS:
49
  <?php var_dump( get_option( 'arve_options_main' ) ); ?>
50
  <?php var_dump( get_option( 'arve_options_params' ) ); ?>
51
  <?php var_dump( get_option( 'arve_options_shortcodes' ) ); ?>
52
+ <?php if ( is_plugin_active( 'arve-pro/arve-pro.php' ) ) : ?>
53
  ARVE PRO OPTIONS:
54
+ <?php
55
+ $pro_options = get_option( 'arve_options_pro' );
56
+ unset( $pro_options['key'] );
57
+ var_dump( $pro_options );
58
+ ?>
59
  <?php endif; ?>
60
  </textarea>
admin/html-settings-page.php CHANGED
@@ -59,7 +59,7 @@ $options = arve_get_options();
59
 
60
  <?php endif; ?>
61
 
62
- <h2><?php esc_html_e( get_admin_page_title() ); ?></h2>
63
 
64
  <h2 class="nav-tab-wrapper arve-settings-tabs"></h2>
65
 
@@ -68,7 +68,7 @@ $options = arve_get_options();
68
  <?php do_settings_sections( ARVE_SLUG ); ?>
69
  <?php settings_fields( 'arve-settings-group' ); ?>
70
 
71
- <input type="hidden" id="arve_options_main[last_settings_tab]" name="arve_options_main[last_settings_tab]" value="<?php esc_attr_e( $options['last_settings_tab'] ); ?>">
72
 
73
  </form>
74
 
59
 
60
  <?php endif; ?>
61
 
62
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
63
 
64
  <h2 class="nav-tab-wrapper arve-settings-tabs"></h2>
65
 
68
  <?php do_settings_sections( ARVE_SLUG ); ?>
69
  <?php settings_fields( 'arve-settings-group' ); ?>
70
 
71
+ <input type="hidden" id="arve_options_main[last_settings_tab]" name="arve_options_main[last_settings_tab]" value="<?php echo esc_attr( $options['last_settings_tab'] ); ?>">
72
 
73
  </form>
74
 
admin/index.php CHANGED
@@ -1 +1 @@
1
- <?php // Silence is golden
1
+ <?php // Silence is golden
advanced-responsive-video-embedder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: ARVE Advanced Responsive Video Embedder
4
  * Plugin URI: https://nextgenthemes.com/plugins/arve-pro/
5
  * Description: Easy responsive video embeds via URL (like WordPress) or Shortcodes. Supports almost anything you can imagine.
6
- * Version: 8.10.10
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
@@ -17,7 +17,7 @@ if ( ! defined( 'WPINC' ) ) {
17
  }
18
 
19
  define( 'ARVE_SLUG', 'advanced-responsive-video-embedder' );
20
- define( 'ARVE_VERSION', '8.10.10' );
21
  define( 'ARVE_PRO_VERSION_REQUIRED', '4.2.5' );
22
 
23
  define( 'ARVE_URL', plugin_dir_url( __FILE__ ) );
@@ -27,7 +27,6 @@ define( 'ARVE_ADMIN_URL', ARVE_URL . 'admin/' );
27
  define( 'ARVE_PATH', plugin_dir_path( __FILE__ ) );
28
  define( 'ARVE_NUM_TRACKS', 10 );
29
 
30
- #add_action( 'init', 'arve_init' );
31
  arve_init();
32
 
33
  function arve_init() {
3
  * Plugin Name: ARVE Advanced Responsive Video Embedder
4
  * Plugin URI: https://nextgenthemes.com/plugins/arve-pro/
5
  * Description: Easy responsive video embeds via URL (like WordPress) or Shortcodes. Supports almost anything you can imagine.
6
+ * Version: 8.10.12
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
17
  }
18
 
19
  define( 'ARVE_SLUG', 'advanced-responsive-video-embedder' );
20
+ define( 'ARVE_VERSION', '8.10.12' );
21
  define( 'ARVE_PRO_VERSION_REQUIRED', '4.2.5' );
22
 
23
  define( 'ARVE_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'ARVE_PATH', plugin_dir_path( __FILE__ ) );
28
  define( 'ARVE_NUM_TRACKS', 10 );
29
 
 
30
  arve_init();
31
 
32
  function arve_init() {
public/functions-html-output.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  function arve_html_id( $html_attr ) {
4
 
5
- if( ! arve_contains( $html_attr, 'id=' ) ) {
6
  $html_attr .= ' id="arve"';
7
  }
8
 
@@ -11,7 +11,7 @@ function arve_html_id( $html_attr ) {
11
 
12
  function arve_get_var_dump( $var ) {
13
  ob_start();
14
- var_dump( $var );
15
  return ob_get_clean();
16
  };
17
 
@@ -19,6 +19,7 @@ function arve_get_debug_info( $input_html, $atts, $input_atts ) {
19
 
20
  $html = '';
21
 
 
22
  if ( isset( $_GET['arve-debug-options'] ) ) {
23
 
24
  static $show_options_debug = true;
@@ -58,6 +59,7 @@ function arve_get_debug_info( $input_html, $atts, $input_atts ) {
58
  $html .= sprintf( '<pre style="%s"">%s</pre>', esc_attr( $pre_style ), esc_html( $input_html ) );
59
  }
60
 
 
61
  return $html;
62
  }
63
 
@@ -84,7 +86,7 @@ function arve_build_meta_html( $a ) {
84
  $meta .= sprintf( '<meta itemprop="duration" content="PT%s">', esc_attr( $a['duration'] ) );
85
  }
86
 
87
- if( ! empty( $a['img_src'] ) ) :
88
 
89
  $thumbnail = sprintf( '<meta itemprop="thumbnailUrl" content="%s">', esc_attr( $a['img_src'] ) );
90
 
@@ -118,7 +120,7 @@ function arve_build_meta_html( $a ) {
118
  }
119
 
120
  if ( ! empty( $a['description'] ) ) {
121
- $meta .= sprintf( '<span itemprop="description" class="arve-description arve-hidden">%s</span>', esc_html( trim( $a['description'] ) ) );
122
  }
123
 
124
  return $meta;
@@ -152,7 +154,7 @@ function arve_build_promote_link_html( $arve_link ) {
152
  return sprintf(
153
  '<a href="%s" title="%s" class="arve-promote-link" target="_blank">%s</a>',
154
  esc_url( 'https://nextgenthemes.com/plugins/arve-pro/' ),
155
- esc_attr( __( 'Embedded with ARVE Advanced Responsive Video Embedder WordPress plugin', ARVE_SLUG) ),
156
  esc_html__( 'ARVE', ARVE_SLUG )
157
  );
158
  }
@@ -175,7 +177,7 @@ function arve_arve_embed_container( $html, $atts ) {
175
 
176
  function arve_arve_wrapper( $html, $atts ) {
177
 
178
- $element = ( 'link-lightbox' == $atts['mode'] ) ? 'span' : 'div';
179
 
180
  return sprintf(
181
  '<%s%s>%s</%s>',
@@ -188,17 +190,14 @@ function arve_arve_wrapper( $html, $atts ) {
188
 
189
  function arve_video_or_iframe( $atts ) {
190
 
191
- switch( $atts['provider'] ) {
192
 
193
  case 'veoh':
194
  return arve_create_object( $atts );
195
- break;
196
  case 'html5':
197
  return arve_create_video_tag( $atts );
198
- break;
199
  default:
200
  return arve_create_iframe_tag( $atts );
201
- break;
202
  }
203
  }
204
 
@@ -209,7 +208,7 @@ function arve_video_or_iframe( $atts ) {
209
  */
210
  function arve_create_iframe_tag( $a ) {
211
 
212
- if ( in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ) ) ) {
213
  $html = sprintf(
214
  '<span class="arve-lazyload"%s></span>',
215
  arve_attr( arve_prefix_array_keys( 'data-', $a['iframe_attr'] ) )
@@ -249,7 +248,7 @@ function arve_error( $message ) {
249
 
250
  return sprintf(
251
  '<p><strong>%s</strong> %s</p>',
252
- __('<abbr title="Advanced Responsive Video Embedder">ARVE</abbr> Error:', ARVE_SLUG ),
253
  $message
254
  );
255
  }
@@ -259,7 +258,7 @@ function arve_output_errors( $atts ) {
259
  $errors = '';
260
 
261
  foreach ( $atts as $key => $value ) {
262
- if( is_wp_error( $value ) ) {
263
  $errors .= arve_error( $value->get_error_message() );
264
  }
265
  }
2
 
3
  function arve_html_id( $html_attr ) {
4
 
5
+ if ( ! arve_contains( $html_attr, 'id=' ) ) {
6
  $html_attr .= ' id="arve"';
7
  }
8
 
11
 
12
  function arve_get_var_dump( $var ) {
13
  ob_start();
14
+ var_dump( $var ); // phpcs:ignore
15
  return ob_get_clean();
16
  };
17
 
19
 
20
  $html = '';
21
 
22
+ // phpcs:disable WordPress.Security.NonceVerification.Recommended
23
  if ( isset( $_GET['arve-debug-options'] ) ) {
24
 
25
  static $show_options_debug = true;
59
  $html .= sprintf( '<pre style="%s"">%s</pre>', esc_attr( $pre_style ), esc_html( $input_html ) );
60
  }
61
 
62
+ // phpcs:enable WordPress.Security.NonceVerification.Recommended
63
  return $html;
64
  }
65
 
86
  $meta .= sprintf( '<meta itemprop="duration" content="PT%s">', esc_attr( $a['duration'] ) );
87
  }
88
 
89
+ if ( ! empty( $a['img_src'] ) ) :
90
 
91
  $thumbnail = sprintf( '<meta itemprop="thumbnailUrl" content="%s">', esc_attr( $a['img_src'] ) );
92
 
120
  }
121
 
122
  if ( ! empty( $a['description'] ) ) {
123
+ $meta .= sprintf( '<span itemprop="description" class="arve-description arve-hidden">%s</span>', esc_html( trim( $a['description'] ) ) );
124
  }
125
 
126
  return $meta;
154
  return sprintf(
155
  '<a href="%s" title="%s" class="arve-promote-link" target="_blank">%s</a>',
156
  esc_url( 'https://nextgenthemes.com/plugins/arve-pro/' ),
157
+ esc_attr( __( 'Embedded with ARVE Advanced Responsive Video Embedder WordPress plugin', ARVE_SLUG ) ),
158
  esc_html__( 'ARVE', ARVE_SLUG )
159
  );
160
  }
177
 
178
  function arve_arve_wrapper( $html, $atts ) {
179
 
180
+ $element = ( 'link-lightbox' === $atts['mode'] ) ? 'span' : 'div';
181
 
182
  return sprintf(
183
  '<%s%s>%s</%s>',
190
 
191
  function arve_video_or_iframe( $atts ) {
192
 
193
+ switch ( $atts['provider'] ) {
194
 
195
  case 'veoh':
196
  return arve_create_object( $atts );
 
197
  case 'html5':
198
  return arve_create_video_tag( $atts );
 
199
  default:
200
  return arve_create_iframe_tag( $atts );
 
201
  }
202
  }
203
 
208
  */
209
  function arve_create_iframe_tag( $a ) {
210
 
211
+ if ( in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ), true ) ) {
212
  $html = sprintf(
213
  '<span class="arve-lazyload"%s></span>',
214
  arve_attr( arve_prefix_array_keys( 'data-', $a['iframe_attr'] ) )
248
 
249
  return sprintf(
250
  '<p><strong>%s</strong> %s</p>',
251
+ __( '<abbr title="Advanced Responsive Video Embedder">ARVE</abbr> Error:', ARVE_SLUG ),
252
  $message
253
  );
254
  }
258
  $errors = '';
259
 
260
  foreach ( $atts as $key => $value ) {
261
+ if ( is_wp_error( $value ) ) {
262
  $errors .= arve_error( $value->get_error_message() );
263
  }
264
  }
public/functions-misc.php CHANGED
@@ -2,11 +2,15 @@
2
 
3
  function arve_is_bool_option( $array ) {
4
 
5
- $yes_no = array( '' => 1, 'yes' => 1, 'no' => 1 );
 
 
 
 
6
 
7
  $check = array_diff_key( $array, $yes_no );
8
 
9
- if( empty( $check ) ) {
10
  return 'bool';
11
  } else {
12
  return $array;
@@ -34,7 +38,7 @@ function arve_get_first_array_value( $array ) {
34
 
35
  function arve_prefix_array_keys( $keyprefix, $array ) {
36
 
37
- foreach( $array as $key => $value ) {
38
  $array[ $keyprefix . $key ] = $value;
39
  unset( $array[ $key ] );
40
  }
@@ -62,11 +66,13 @@ function arve_check_filetype( $url, $ext ) {
62
  */
63
  function arve_youtube_time_to_seconds( $yttime ) {
64
 
65
- $format = false;
66
- $hours = $minutes = $seconds = 0;
 
 
67
 
68
  $pattern['hms'] = '/([0-9]+)h([0-9]+)m([0-9]+)s/'; // hours, minutes, seconds
69
- $pattern['ms'] = '/([0-9]+)m([0-9]+)s/'; // minutes, seconds
70
  $pattern['h'] = '/([0-9]+)h/';
71
  $pattern['m'] = '/([0-9]+)m/';
72
  $pattern['s'] = '/([0-9]+)s/';
2
 
3
  function arve_is_bool_option( $array ) {
4
 
5
+ $yes_no = array(
6
+ '' => 1,
7
+ 'yes' => 1,
8
+ 'no' => 1
9
+ );
10
 
11
  $check = array_diff_key( $array, $yes_no );
12
 
13
+ if ( empty( $check ) ) {
14
  return 'bool';
15
  } else {
16
  return $array;
38
 
39
  function arve_prefix_array_keys( $keyprefix, $array ) {
40
 
41
+ foreach ( $array as $key => $value ) {
42
  $array[ $keyprefix . $key ] = $value;
43
  unset( $array[ $key ] );
44
  }
66
  */
67
  function arve_youtube_time_to_seconds( $yttime ) {
68
 
69
+ $format = false;
70
+ $hours = 0;
71
+ $minutes = 0;
72
+ $seconds = 0;
73
 
74
  $pattern['hms'] = '/([0-9]+)h([0-9]+)m([0-9]+)s/'; // hours, minutes, seconds
75
+ $pattern['ms'] = '/([0-9]+)m([0-9]+)s/'; // minutes, seconds
76
  $pattern['h'] = '/([0-9]+)h/';
77
  $pattern['m'] = '/([0-9]+)m/';
78
  $pattern['s'] = '/([0-9]+)s/';
public/functions-shortcode-data.php CHANGED
@@ -15,7 +15,7 @@ function arve_get_html5_attributes() {
15
 
16
  function arve_url_query_array( $url ) {
17
 
18
- $url = parse_url( $url );
19
 
20
  if ( empty( $url['query'] ) ) {
21
  return array();
@@ -31,7 +31,7 @@ function arve_build_iframe_src( $atts ) {
31
  $id = $atts['id'];
32
  $lang = $atts['lang'];
33
  $provider = $atts['provider'];
34
- $options = arve_get_options();
35
  $properties = arve_get_host_properties();
36
 
37
  if ( $options['youtube_nocookie'] ) {
@@ -45,41 +45,24 @@ function arve_build_iframe_src( $atts ) {
45
  $pattern = '%s';
46
  }
47
 
48
- if ( 'facebook' == $provider && is_numeric( $id ) ) {
49
 
50
  $id = "https://www.facebook.com/facebook/videos/$id/";
51
 
52
- } elseif ( 'twitch' == $provider && is_numeric( $id ) ) {
53
 
54
  $pattern = 'https://player.twitch.tv/?video=v%s';
55
 
56
- } elseif ( 'ted' == $provider && preg_match( "/^[a-z]{2}$/", $lang ) === 1 ) {
57
 
58
  $pattern = 'https://embed-ssl.ted.com/talks/lang/' . $lang . '/%s.html';
59
  }
60
 
61
  if ( isset( $properties[ $provider ]['url_encode_id'] ) && $properties[ $provider ]['url_encode_id'] ) {
62
- $id = urlencode( $id );
63
  }
64
 
65
- #$test = 'https://www.dailymotion.com/widget/jukebox?list[]=/playlist/xr8ts/1&&autoplay=0&mute=0';
66
-
67
- #
68
- #$org = 'http://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2Fxr2rp_RTnews_exclusive-interveiws%2F1&&autoplay=0&mute=0';
69
-
70
- #$esc_url = esc_url( $test );
71
-
72
- #d( $provider );
73
- #d( ( $esc_url === $org ) );
74
- #d( $esc_url );
75
- #printf( '<iframe src="%s" width="600" height="500"></iframe>', $org );
76
-
77
- #dd("end");
78
-
79
- #d($provider);
80
- #d($pattern);
81
-
82
- if ( 'brightcove' == $provider ) {
83
  $src = sprintf( $pattern, $atts['brightcove_account'], $atts['brightcove_player'], $atts['brightcove_embed'], $id );
84
  } else {
85
  $src = sprintf( $pattern, $id );
@@ -91,7 +74,7 @@ function arve_build_iframe_src( $atts ) {
91
  function arve_id_fixes( $id, $provider ) {
92
 
93
  if (
94
- 'liveleak' == $provider &&
95
  ! arve_starts_with( $id, 'i=' ) &&
96
  ! arve_starts_with( $id, 'f=' )
97
  ) {
@@ -122,7 +105,7 @@ function arve_add_autoplay_query_arg( $src, $a ) {
122
  case 'archiveorg':
123
  case 'dailymotion':
124
  case 'dailymotionlist':
125
- #case 'facebook': # Causes automute FUCK NSABOOK
126
  case 'vevo':
127
  case 'viddler':
128
  case 'vimeo':
@@ -162,23 +145,6 @@ function arve_add_autoplay_query_arg( $src, $a ) {
162
  $on = add_query_arg( 'player_autoplay', 'true', $src );
163
  $off = add_query_arg( 'player_autoplay', 'false', $src );
164
  break;
165
- /*
166
- case 'iframe':
167
- # We are spamming all kinds of autoplay parameters here in hope of a effect
168
- $on = add_query_arg( array(
169
- 'ap' => '1',
170
- 'autoplay' => '1',
171
- 'autoStart' => 'true',
172
- 'player_autoStart' => 'true',
173
- ), $src );
174
- $off = add_query_arg( array(
175
- 'ap' => '0',
176
- 'autoplay' => '0',
177
- 'autoStart' => 'false',
178
- 'player_autoStart' => 'false',
179
- ), $src );
180
- break;
181
- */
182
  default:
183
  # Do nothing for providers that to not support autoplay or fail with parameters
184
  $on = $src;
@@ -186,7 +152,7 @@ function arve_add_autoplay_query_arg( $src, $a ) {
186
  break;
187
  }
188
 
189
- if( $a['autoplay'] ) {
190
  return $on;
191
  } else {
192
  return $off;
@@ -215,7 +181,7 @@ function arve_maxwidth_when_aligned( $maxwidth, $align ) {
215
 
216
  $options = arve_get_options();
217
 
218
- if ( $maxwidth < 100 && in_array( $align, array( 'left', 'right', 'center' ) ) ) {
219
  $maxwidth = (int) $options['align_maxwidth'];
220
  }
221
 
@@ -231,101 +197,101 @@ function arve_get_language_name_from_code( $lang_code ) {
231
  // make otherwise strange looking PHP syntax natural (to not be displayed in
232
  // right to left). See https://www.drupal.org/node/128866#comment-528929.
233
  $lang = array(
234
- 'af' => array('Afrikaans', 'Afrikaans'),
235
- 'am' => array('Amharic', 'አማርኛ'),
236
- 'ar' => array('Arabic', /* Left-to-right marker "‭" */ 'العربية', 'RTL' ),
237
- 'ast' => array('Asturian', 'Asturianu'),
238
- 'az' => array('Azerbaijani', 'Azərbaycanca'),
239
- 'be' => array('Belarusian', 'Беларуская'),
240
- 'bg' => array('Bulgarian', 'Български'),
241
- 'bn' => array('Bengali', 'বাংলা'),
242
- 'bo' => array('Tibetan', 'བོད་སྐད་'),
243
- 'bs' => array('Bosnian', 'Bosanski'),
244
- 'ca' => array('Catalan', 'Català'),
245
- 'cs' => array('Czech', 'Čeština'),
246
- 'cy' => array('Welsh', 'Cymraeg'),
247
- 'da' => array('Danish', 'Dansk'),
248
- 'de' => array('German', 'Deutsch'),
249
- 'dz' => array('Dzongkha', 'རྫོང་ཁ'),
250
- 'el' => array('Greek', 'Ελληνικά'),
251
- 'en' => array('English', 'English'),
252
- 'en-x-simple' => array('Simple English', 'Simple English'),
253
- 'eo' => array('Esperanto', 'Esperanto'),
254
- 'es' => array('Spanish', 'Español'),
255
- 'et' => array('Estonian', 'Eesti'),
256
- 'eu' => array('Basque', 'Euskera'),
257
- 'fa' => array('Persian, Farsi', /* Left-to-right marker "‭" */ 'فارسی', 'RTL' ),
258
- 'fi' => array('Finnish', 'Suomi'),
259
- 'fil' => array('Filipino', 'Filipino'),
260
- 'fo' => array('Faeroese', 'Føroyskt'),
261
- 'fr' => array('French', 'Français'),
262
- 'fy' => array('Frisian, Western', 'Frysk'),
263
- 'ga' => array('Irish', 'Gaeilge'),
264
- 'gd' => array('Scots Gaelic', 'Gàidhlig'),
265
- 'gl' => array('Galician', 'Galego'),
266
- 'gsw-berne' => array('Swiss German', 'Schwyzerdütsch'),
267
- 'gu' => array('Gujarati', 'ગુજરાતી'),
268
- 'he' => array('Hebrew', /* Left-to-right marker "‭" */ 'עברית', 'RTL' ),
269
- 'hi' => array('Hindi', 'हिन्दी'),
270
- 'hr' => array('Croatian', 'Hrvatski'),
271
- 'ht' => array('Haitian Creole', 'Kreyòl ayisyen'),
272
- 'hu' => array('Hungarian', 'Magyar'),
273
- 'hy' => array('Armenian', 'Հայերեն'),
274
- 'id' => array('Indonesian', 'Bahasa Indonesia'),
275
- 'is' => array('Icelandic', 'Íslenska'),
276
- 'it' => array('Italian', 'Italiano'),
277
- 'ja' => array('Japanese', '日本語'),
278
- 'jv' => array('Javanese', 'Basa Java'),
279
- 'ka' => array('Georgian', 'ქართული ენა'),
280
- 'kk' => array('Kazakh', 'Қазақ'),
281
- 'km' => array('Khmer', 'ភាសាខ្មែរ'),
282
- 'kn' => array('Kannada', 'ಕನ್ನಡ'),
283
- 'ko' => array('Korean', '한국어'),
284
- 'ku' => array('Kurdish', 'Kurdî'),
285
- 'ky' => array('Kyrgyz', 'Кыргызча'),
286
- 'lo' => array('Lao', 'ພາສາລາວ'),
287
- 'lt' => array('Lithuanian', 'Lietuvių'),
288
- 'lv' => array('Latvian', 'Latviešu'),
289
- 'mg' => array('Malagasy', 'Malagasy'),
290
- 'mk' => array('Macedonian', 'Македонски'),
291
- 'ml' => array('Malayalam', 'മലയാളം'),
292
- 'mn' => array('Mongolian', 'монгол'),
293
- 'mr' => array('Marathi', 'मराठी'),
294
- 'ms' => array('Bahasa Malaysia', 'بهاس ملايو'),
295
- 'my' => array('Burmese', 'ဗမာစကား'),
296
- 'ne' => array('Nepali', 'नेपाली'),
297
- 'nl' => array('Dutch', 'Nederlands'),
298
- 'nb' => array('Norwegian Bokmål', 'Norsk, bokmål'),
299
- 'nn' => array('Norwegian Nynorsk', 'Norsk, nynorsk'),
300
- 'oc' => array('Occitan', 'Occitan'),
301
- 'pa' => array('Punjabi', 'ਪੰਜਾਬੀ'),
302
- 'pl' => array('Polish', 'Polski'),
303
- 'pt-pt' => array('Portuguese, Portugal', 'Português, Portugal'),
304
- 'pt-br' => array('Portuguese, Brazil', 'Português, Brasil'),
305
- 'ro' => array('Romanian', 'Română'),
306
- 'ru' => array('Russian', 'Русский'),
307
- 'sco' => array('Scots', 'Scots'),
308
- 'se' => array('Northern Sami', 'Sámi'),
309
- 'si' => array('Sinhala', 'සිංහල'),
310
- 'sk' => array('Slovak', 'Slovenčina'),
311
- 'sl' => array('Slovenian', 'Slovenščina'),
312
- 'sq' => array('Albanian', 'Shqip'),
313
- 'sr' => array('Serbian', 'Српски'),
314
- 'sv' => array('Swedish', 'Svenska'),
315
- 'sw' => array('Swahili', 'Kiswahili'),
316
- 'ta' => array('Tamil', 'தமிழ்'),
317
- 'ta-lk' => array('Tamil, Sri Lanka', 'தமிழ், இலங்கை'),
318
- 'te' => array('Telugu', 'తెలుగు'),
319
- 'th' => array('Thai', 'ภาษาไทย'),
320
- 'tr' => array('Turkish', 'Türkçe'),
321
- 'tyv' => array('Tuvan', 'Тыва дыл'),
322
- 'ug' => array('Uyghur', 'Уйғур'),
323
- 'uk' => array('Ukrainian', 'Українська'),
324
- 'ur' => array('Urdu', /* Left-to-right marker "‭" */ 'اردو', 'RTL' ),
325
- 'vi' => array('Vietnamese', 'Tiếng Việt'),
326
- 'xx-lolspeak' => array('Lolspeak', 'Lolspeak'),
327
- 'zh-hans' => array('Chinese, Simplified', '简体中文'),
328
- 'zh-hant' => array('Chinese, Traditional', '繁體中文'),
329
  );
330
 
331
  return $lang[ $lang_code ][1];
15
 
16
  function arve_url_query_array( $url ) {
17
 
18
+ $url = wp_parse_url( $url );
19
 
20
  if ( empty( $url['query'] ) ) {
21
  return array();
31
  $id = $atts['id'];
32
  $lang = $atts['lang'];
33
  $provider = $atts['provider'];
34
+ $options = arve_get_options();
35
  $properties = arve_get_host_properties();
36
 
37
  if ( $options['youtube_nocookie'] ) {
45
  $pattern = '%s';
46
  }
47
 
48
+ if ( 'facebook' === $provider && is_numeric( $id ) ) {
49
 
50
  $id = "https://www.facebook.com/facebook/videos/$id/";
51
 
52
+ } elseif ( 'twitch' === $provider && is_numeric( $id ) ) {
53
 
54
  $pattern = 'https://player.twitch.tv/?video=v%s';
55
 
56
+ } elseif ( 'ted' === $provider && preg_match( '/^[a-z]{2}$/', $lang ) === 1 ) {
57
 
58
  $pattern = 'https://embed-ssl.ted.com/talks/lang/' . $lang . '/%s.html';
59
  }
60
 
61
  if ( isset( $properties[ $provider ]['url_encode_id'] ) && $properties[ $provider ]['url_encode_id'] ) {
62
+ $id = rawurlencode( $id );
63
  }
64
 
65
+ if ( 'brightcove' === $provider ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  $src = sprintf( $pattern, $atts['brightcove_account'], $atts['brightcove_player'], $atts['brightcove_embed'], $id );
67
  } else {
68
  $src = sprintf( $pattern, $id );
74
  function arve_id_fixes( $id, $provider ) {
75
 
76
  if (
77
+ 'liveleak' === $provider &&
78
  ! arve_starts_with( $id, 'i=' ) &&
79
  ! arve_starts_with( $id, 'f=' )
80
  ) {
105
  case 'archiveorg':
106
  case 'dailymotion':
107
  case 'dailymotionlist':
108
+ case 'facebook':
109
  case 'vevo':
110
  case 'viddler':
111
  case 'vimeo':
145
  $on = add_query_arg( 'player_autoplay', 'true', $src );
146
  $off = add_query_arg( 'player_autoplay', 'false', $src );
147
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  default:
149
  # Do nothing for providers that to not support autoplay or fail with parameters
150
  $on = $src;
152
  break;
153
  }
154
 
155
+ if ( $a['autoplay'] ) {
156
  return $on;
157
  } else {
158
  return $off;
181
 
182
  $options = arve_get_options();
183
 
184
+ if ( $maxwidth < 100 && in_array( $align, array( 'left', 'right', 'center' ), true ) ) {
185
  $maxwidth = (int) $options['align_maxwidth'];
186
  }
187
 
197
  // make otherwise strange looking PHP syntax natural (to not be displayed in
198
  // right to left). See https://www.drupal.org/node/128866#comment-528929.
199
  $lang = array(
200
+ 'af' => array( 'Afrikaans', 'Afrikaans' ),
201
+ 'am' => array( 'Amharic', 'አማርኛ' ),
202
+ 'ar' => array( 'Arabic', /* Left-to-right marker "‭" */ 'العربية', 'RTL' ),
203
+ 'ast' => array( 'Asturian', 'Asturianu' ),
204
+ 'az' => array( 'Azerbaijani', 'Azərbaycanca' ),
205
+ 'be' => array( 'Belarusian', 'Беларуская' ),
206
+ 'bg' => array( 'Bulgarian', 'Български' ),
207
+ 'bn' => array( 'Bengali', 'বাংলা' ),
208
+ 'bo' => array( 'Tibetan', 'བོད་སྐད་' ),
209
+ 'bs' => array( 'Bosnian', 'Bosanski' ),
210
+ 'ca' => array( 'Catalan', 'Català' ),
211
+ 'cs' => array( 'Czech', 'Čeština' ),
212
+ 'cy' => array( 'Welsh', 'Cymraeg' ),
213
+ 'da' => array( 'Danish', 'Dansk' ),
214
+ 'de' => array( 'German', 'Deutsch' ),
215
+ 'dz' => array( 'Dzongkha', 'རྫོང་ཁ' ),
216
+ 'el' => array( 'Greek', 'Ελληνικά' ),
217
+ 'en' => array( 'English', 'English' ),
218
+ 'en-x-simple' => array( 'Simple English', 'Simple English' ),
219
+ 'eo' => array( 'Esperanto', 'Esperanto' ),
220
+ 'es' => array( 'Spanish', 'Español' ),
221
+ 'et' => array( 'Estonian', 'Eesti' ),
222
+ 'eu' => array( 'Basque', 'Euskera' ),
223
+ 'fa' => array( 'Persian, Farsi', /* Left-to-right marker "‭" */ 'فارسی', 'RTL' ),
224
+ 'fi' => array( 'Finnish', 'Suomi' ),
225
+ 'fil' => array( 'Filipino', 'Filipino' ),
226
+ 'fo' => array( 'Faeroese', 'Føroyskt' ),
227
+ 'fr' => array( 'French', 'Français' ),
228
+ 'fy' => array( 'Frisian, Western', 'Frysk' ),
229
+ 'ga' => array( 'Irish', 'Gaeilge' ),
230
+ 'gd' => array( 'Scots Gaelic', 'Gàidhlig' ),
231
+ 'gl' => array( 'Galician', 'Galego' ),
232
+ 'gsw-berne' => array( 'Swiss German', 'Schwyzerdütsch' ),
233
+ 'gu' => array( 'Gujarati', 'ગુજરાતી' ),
234
+ 'he' => array( 'Hebrew', /* Left-to-right marker "‭" */ 'עברית', 'RTL' ),
235
+ 'hi' => array( 'Hindi', 'हिन्दी' ),
236
+ 'hr' => array( 'Croatian', 'Hrvatski' ),
237
+ 'ht' => array( 'Haitian Creole', 'Kreyòl ayisyen' ),
238
+ 'hu' => array( 'Hungarian', 'Magyar' ),
239
+ 'hy' => array( 'Armenian', 'Հայերեն' ),
240
+ 'id' => array( 'Indonesian', 'Bahasa Indonesia' ),
241
+ 'is' => array( 'Icelandic', 'Íslenska' ),
242
+ 'it' => array( 'Italian', 'Italiano' ),
243
+ 'ja' => array( 'Japanese', '日本語' ),
244
+ 'jv' => array( 'Javanese', 'Basa Java' ),
245
+ 'ka' => array( 'Georgian', 'ქართული ენა' ),
246
+ 'kk' => array( 'Kazakh', 'Қазақ' ),
247
+ 'km' => array( 'Khmer', 'ភាសាខ្មែរ' ),
248
+ 'kn' => array( 'Kannada', 'ಕನ್ನಡ' ),
249
+ 'ko' => array( 'Korean', '한국어' ),
250
+ 'ku' => array( 'Kurdish', 'Kurdî' ),
251
+ 'ky' => array( 'Kyrgyz', 'Кыргызча' ),
252
+ 'lo' => array( 'Lao', 'ພາສາລາວ' ),
253
+ 'lt' => array( 'Lithuanian', 'Lietuvių' ),
254
+ 'lv' => array( 'Latvian', 'Latviešu' ),
255
+ 'mg' => array( 'Malagasy', 'Malagasy' ),
256
+ 'mk' => array( 'Macedonian', 'Македонски' ),
257
+ 'ml' => array( 'Malayalam', 'മലയാളം' ),
258
+ 'mn' => array( 'Mongolian', 'монгол' ),
259
+ 'mr' => array( 'Marathi', 'मराठी' ),
260
+ 'ms' => array( 'Bahasa Malaysia', 'بهاس ملايو' ),
261
+ 'my' => array( 'Burmese', 'ဗမာစကား' ),
262
+ 'ne' => array( 'Nepali', 'नेपाली' ),
263
+ 'nl' => array( 'Dutch', 'Nederlands' ),
264
+ 'nb' => array( 'Norwegian Bokmål', 'Norsk, bokmål' ),
265
+ 'nn' => array( 'Norwegian Nynorsk', 'Norsk, nynorsk' ),
266
+ 'oc' => array( 'Occitan', 'Occitan' ),
267
+ 'pa' => array( 'Punjabi', 'ਪੰਜਾਬੀ' ),
268
+ 'pl' => array( 'Polish', 'Polski' ),
269
+ 'pt-pt' => array( 'Portuguese, Portugal', 'Português, Portugal' ),
270
+ 'pt-br' => array( 'Portuguese, Brazil', 'Português, Brasil' ),
271
+ 'ro' => array( 'Romanian', 'Română' ),
272
+ 'ru' => array( 'Russian', 'Русский' ),
273
+ 'sco' => array( 'Scots', 'Scots' ),
274
+ 'se' => array( 'Northern Sami', 'Sámi' ),
275
+ 'si' => array( 'Sinhala', 'සිංහල' ),
276
+ 'sk' => array( 'Slovak', 'Slovenčina' ),
277
+ 'sl' => array( 'Slovenian', 'Slovenščina' ),
278
+ 'sq' => array( 'Albanian', 'Shqip' ),
279
+ 'sr' => array( 'Serbian', 'Српски' ),
280
+ 'sv' => array( 'Swedish', 'Svenska' ),
281
+ 'sw' => array( 'Swahili', 'Kiswahili' ),
282
+ 'ta' => array( 'Tamil', 'தமிழ்' ),
283
+ 'ta-lk' => array( 'Tamil, Sri Lanka', 'தமிழ், இலங்கை' ),
284
+ 'te' => array( 'Telugu', 'తెలుగు' ),
285
+ 'th' => array( 'Thai', 'ภาษาไทย' ),
286
+ 'tr' => array( 'Turkish', 'Türkçe' ),
287
+ 'tyv' => array( 'Tuvan', 'Тыва дыл' ),
288
+ 'ug' => array( 'Uyghur', 'Уйғур' ),
289
+ 'uk' => array( 'Ukrainian', 'Українська' ),
290
+ 'ur' => array( 'Urdu', /* Left-to-right marker "‭" */ 'اردو', 'RTL' ),
291
+ 'vi' => array( 'Vietnamese', 'Tiếng Việt' ),
292
+ 'xx-lolspeak' => array( 'Lolspeak', 'Lolspeak' ),
293
+ 'zh-hans' => array( 'Chinese, Simplified', '简体中文' ),
294
+ 'zh-hant' => array( 'Chinese, Traditional', '繁體中文' ),
295
  );
296
 
297
  return $lang[ $lang_code ][1];
public/functions-shortcode-filters.php CHANGED
@@ -2,9 +2,7 @@
2
 
3
  function arve_load_vimeo_api( $a ) {
4
 
5
- if ( true ) {
6
- require_once ARVE_PATH . '/vendor/autoload.php';
7
- }
8
 
9
  return $a;
10
  }
@@ -12,7 +10,7 @@ function arve_load_vimeo_api( $a ) {
12
  function arve_get_wrapper_id( $a ) {
13
 
14
  static $wrapper_ids = array();
15
- $wrapper_id = null;
16
 
17
  foreach ( array( 'id', 'mp4', 'm4v', 'webm', 'ogv', 'url', 'random_video_url', 'webtorrent' ) as $att ) {
18
 
@@ -29,7 +27,7 @@ function arve_get_wrapper_id( $a ) {
29
  $wrapper_ids[] = $wrapper_id;
30
  }
31
 
32
- if ( in_array( $wrapper_id, $wrapper_ids ) ) {
33
  $id_counts = array_count_values( $wrapper_ids );
34
  $id_count = $id_counts[ $wrapper_id ];
35
 
@@ -58,27 +56,27 @@ function arve_sc_filter_attr( $a ) {
58
  'id' => $wrapper_id,
59
  'style' => empty( $a['maxwidth'] ) ? false : sprintf( 'max-width:%dpx;', $a['maxwidth'] ),
60
  // Schema.org
61
- 'itemscope' => '',
62
- 'itemtype' => 'http://schema.org/VideoObject',
63
  );
64
 
65
- if( 'html5' == $a['provider'] ) {
66
 
67
  $a['video_attr'] = array(
68
  # WP
69
- 'autoplay' => in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ) ) ? false : $a['autoplay'],
70
- 'controls' => $a['controls'],
71
- 'controlslist' => $a['controlslist'],
72
- 'loop' => $a['loop'],
73
- 'preload' => $a['preload'],
74
- 'width' => empty( $a['width'] ) ? false : $a['width'],
75
- 'height' => empty( $a['height'] ) ? false : $a['height'],
76
- 'poster' => empty( $a['img_src'] ) ? false : $a['img_src'],
77
- 'src' => empty( $a['video_src'] ) ? false : $a['video_src'],
78
  # ARVE only
79
- 'class' => 'arve-video fitvidsignore',
80
- 'muted' => $a['muted'],
81
- 'playsinline' => $a['playsinline'],
82
  'webkit-playsinline' => $a['playsinline'],
83
  );
84
 
@@ -90,7 +88,7 @@ function arve_sc_filter_attr( $a ) {
90
  $iframe_src = arve_add_query_args_to_iframe_src( $iframe_src, $a );
91
  $iframe_src = arve_add_autoplay_query_arg( $iframe_src, $a );
92
 
93
- if ( 'vimeo' == $a['provider'] && ! empty( $a['start'] ) ) {
94
  $iframe_src .= '#t=' . (int) $a['start'];
95
  }
96
 
@@ -103,11 +101,11 @@ function arve_sc_filter_attr( $a ) {
103
  'sandbox' => 'allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox',
104
  'scrolling' => 'no',
105
  'src' => $iframe_src,
106
- 'width' => empty( $a['width'] ) ? false : $a['width'],
107
  'height' => empty( $a['height'] ) ? false : $a['height'],
108
  );
109
 
110
- if ( 'vimeo' == $a['provider'] ) {
111
  $a['iframe_attr']['sandbox'] .= ' allow-forms';
112
  }
113
 
@@ -125,16 +123,16 @@ function arve_sc_filter_validate( $a ) {
125
 
126
  $a['mode'] = arve_validate_mode( $a['mode'], $a['provider'] );
127
 
128
- $a['autoplay'] = arve_validate_bool( $a['autoplay'], 'autoplay' );
129
- $a['arve_link'] = arve_validate_bool( $a['arve_link'], 'arve_link' );
130
- $a['loop'] = arve_validate_bool( $a['loop'], 'loop' );
131
- $a['controls'] = arve_validate_bool( $a['controls'], 'controls' );
132
- $a['sandbox'] = arve_validate_bool( $a['sandbox'], 'sandbox' );
133
- $a['muted'] = arve_validate_bool( $a['muted'], 'muted' );
134
- $a['playsinline'] = arve_validate_bool( $a['playsinline'], 'playsinline' );
135
 
136
- $a['maxwidth'] = (int) $a['maxwidth'];
137
- $a['maxwidth'] = (int) arve_maxwidth_when_aligned( $a['maxwidth'], $a['align'] );
138
 
139
  $a['id'] = arve_id_fixes( $a['id'], $a['provider'] );
140
 
@@ -176,7 +174,7 @@ function arve_sc_filter_sanitise( $atts ) {
176
  function arve_sc_filter_missing_attribute_check( $atts ) {
177
 
178
  # Old shortcodes
179
- if ( ! array_key_exists( 'url' , $atts ) ) {
180
  return $atts;
181
  }
182
 
@@ -185,11 +183,13 @@ function arve_sc_filter_missing_attribute_check( $atts ) {
185
 
186
  $array = array_intersect_key( $atts, array_flip( $required_attributes ) );
187
 
188
- if( count( array_filter( $array ) ) != count( $array ) ) {
189
 
190
- $atts['missing_atts_error'] = arve_error( sprintf(
191
- esc_html__( 'The [arve] shortcode needs one of this attributes %s', ARVE_SLUG ),
192
- implode( $required_attributes ) )
 
 
193
  );
194
  }
195
 
@@ -202,7 +202,7 @@ function arve_sc_filter_get_media_gallery_thumbnail( $atts ) {
202
  return $atts;
203
  }
204
 
205
- if( is_numeric( $atts['thumbnail'] ) ) {
206
 
207
  $attchment_id = $atts['thumbnail'];
208
 
@@ -211,8 +211,7 @@ function arve_sc_filter_get_media_gallery_thumbnail( $atts ) {
211
 
212
  } elseif ( arve_validate_url( $atts['thumbnail'] ) ) {
213
 
214
- $atts['img_src'] = $atts['thumbnail'];
215
- $atts['img_srcset'] = false;
216
 
217
  } else {
218
 
@@ -228,7 +227,7 @@ function arve_sc_filter_get_media_gallery_video( $atts ) {
228
 
229
  foreach ( $html5_ext as $ext ) {
230
 
231
- if( ! empty( $atts[ $ext ] ) && is_numeric( $atts[ $ext ] ) ) {
232
  $atts[ $ext ] = wp_get_attachment_url( $atts[ $ext ] );
233
  }
234
  }
@@ -259,8 +258,8 @@ function arve_sc_filter_detect_provider_and_id_from_url( $atts ) {
259
  foreach ( $matches as $key => $value ) {
260
 
261
  if ( is_string( $key ) ) {
262
- $atts[ 'provider' ] = $host_id;
263
- $atts[ $key ] = $matches[ $key ];
264
  }
265
  }
266
 
@@ -271,7 +270,7 @@ function arve_sc_filter_detect_provider_and_id_from_url( $atts ) {
271
 
272
  function arve_sc_filter_detect_query_args( $atts ) {
273
 
274
- if( empty( $atts['url'] ) ) {
275
  return $atts;
276
  }
277
 
@@ -281,7 +280,7 @@ function arve_sc_filter_detect_query_args( $atts ) {
281
 
282
  foreach ( $to_extract as $provider => $parameters ) {
283
 
284
- if( $provider != $atts['provider'] ) {
285
  return $atts;
286
  }
287
 
@@ -291,7 +290,7 @@ function arve_sc_filter_detect_query_args( $atts ) {
291
 
292
  $att_name = $atts['provider'] . "_$parameter";
293
 
294
- if( empty( $query_array[ $parameter ] ) ) {
295
  $atts[ $att_name ] = new WP_Error( $att_name, "$parameter not found in URL" );
296
  } else {
297
  $atts[ $att_name ] = $query_array[ $parameter ];
@@ -304,14 +303,14 @@ function arve_sc_filter_detect_query_args( $atts ) {
304
 
305
  function arve_sc_filter_detect_youtube_playlist( $atts ) {
306
 
307
- if(
308
- 'youtube' != $atts['provider'] ||
309
  ( empty( $atts['url'] ) && empty( $atts['id'] ) )
310
  ) {
311
  return $atts;
312
  }
313
 
314
- if( empty($atts['url']) ) {
315
  # Not a url but it will work
316
  $url = str_replace( array( '&list=', '&amp;list=' ), '?list=', $atts['id'] );
317
  } else {
@@ -320,7 +319,7 @@ function arve_sc_filter_detect_youtube_playlist( $atts ) {
320
 
321
  $query_array = arve_url_query_array( $url );
322
 
323
- if( empty( $query_array['list'] ) ) {
324
  return $atts;
325
  }
326
 
@@ -335,11 +334,10 @@ function arve_sc_filter_detect_youtube_playlist( $atts ) {
335
 
336
  function arve_get_video_type( $ext ) {
337
 
338
- switch( $ext ) {
339
  case 'ogv':
340
  case 'ogm':
341
  return 'video/ogg';
342
- break;
343
  default:
344
  return 'video/' . $ext;
345
  }
@@ -347,7 +345,7 @@ function arve_get_video_type( $ext ) {
347
 
348
  function arve_sc_filter_detect_html5( $atts ) {
349
 
350
- if( ! empty( $atts['provider'] ) && 'html5' != $atts['provider'] ) {
351
  return $atts;
352
  }
353
 
@@ -372,18 +370,11 @@ function arve_sc_filter_detect_html5( $atts ) {
372
  }
373
 
374
  $atts['video_src'] = $atts['url'];
375
- /*
376
- $parse_url = parse_url( $atts['url'] );
377
- $pathinfo = pathinfo( $parse_url['path'] );
378
-
379
- $url_ext = $pathinfo['extension'];
380
- $url_without_ext = $parse_url['scheme'] . '://' . $parse_url['host'] . $path_without_ext;
381
- */
382
  }
383
 
384
  endforeach;
385
 
386
- if( empty( $atts['video_src'] ) && empty( $atts['video_sources_html'] ) ) {
387
  return $atts;
388
  }
389
 
@@ -408,7 +399,7 @@ function arve_sc_filter_iframe_fallback( $atts ) {
408
 
409
  function arve_sc_filter_build_tracks_html( $atts ) {
410
 
411
- if ( 'html5' != $atts['provider'] ) {
412
  return $atts;
413
  }
414
 
@@ -437,7 +428,7 @@ function arve_sc_filter_build_tracks_html( $atts ) {
437
  'srclang' => $matches['lang'],
438
  );
439
 
440
- $atts['video_tracks_html'] .= sprintf( '<track%s>', arve_attr( $attr) );
441
  }
442
 
443
  return $atts;
2
 
3
  function arve_load_vimeo_api( $a ) {
4
 
5
+ require_once ARVE_PATH . '/vendor/autoload.php';
 
 
6
 
7
  return $a;
8
  }
10
  function arve_get_wrapper_id( $a ) {
11
 
12
  static $wrapper_ids = array();
13
+ $wrapper_id = null;
14
 
15
  foreach ( array( 'id', 'mp4', 'm4v', 'webm', 'ogv', 'url', 'random_video_url', 'webtorrent' ) as $att ) {
16
 
27
  $wrapper_ids[] = $wrapper_id;
28
  }
29
 
30
+ if ( in_array( $wrapper_id, $wrapper_ids, true ) ) {
31
  $id_counts = array_count_values( $wrapper_ids );
32
  $id_count = $id_counts[ $wrapper_id ];
33
 
56
  'id' => $wrapper_id,
57
  'style' => empty( $a['maxwidth'] ) ? false : sprintf( 'max-width:%dpx;', $a['maxwidth'] ),
58
  // Schema.org
59
+ 'itemscope' => '',
60
+ 'itemtype' => 'http://schema.org/VideoObject',
61
  );
62
 
63
+ if ( 'html5' === $a['provider'] ) {
64
 
65
  $a['video_attr'] = array(
66
  # WP
67
+ 'autoplay' => in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ), true ) ? false : $a['autoplay'],
68
+ 'controls' => $a['controls'],
69
+ 'controlslist' => $a['controlslist'],
70
+ 'loop' => $a['loop'],
71
+ 'preload' => $a['preload'],
72
+ 'width' => empty( $a['width'] ) ? false : $a['width'],
73
+ 'height' => empty( $a['height'] ) ? false : $a['height'],
74
+ 'poster' => empty( $a['img_src'] ) ? false : $a['img_src'],
75
+ 'src' => empty( $a['video_src'] ) ? false : $a['video_src'],
76
  # ARVE only
77
+ 'class' => 'arve-video fitvidsignore',
78
+ 'muted' => $a['muted'],
79
+ 'playsinline' => $a['playsinline'],
80
  'webkit-playsinline' => $a['playsinline'],
81
  );
82
 
88
  $iframe_src = arve_add_query_args_to_iframe_src( $iframe_src, $a );
89
  $iframe_src = arve_add_autoplay_query_arg( $iframe_src, $a );
90
 
91
+ if ( 'vimeo' === $a['provider'] && ! empty( $a['start'] ) ) {
92
  $iframe_src .= '#t=' . (int) $a['start'];
93
  }
94
 
101
  'sandbox' => 'allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox',
102
  'scrolling' => 'no',
103
  'src' => $iframe_src,
104
+ 'width' => empty( $a['width'] ) ? false : $a['width'],
105
  'height' => empty( $a['height'] ) ? false : $a['height'],
106
  );
107
 
108
+ if ( 'vimeo' === $a['provider'] ) {
109
  $a['iframe_attr']['sandbox'] .= ' allow-forms';
110
  }
111
 
123
 
124
  $a['mode'] = arve_validate_mode( $a['mode'], $a['provider'] );
125
 
126
+ $a['autoplay'] = arve_validate_bool( $a['autoplay'], 'autoplay' );
127
+ $a['arve_link'] = arve_validate_bool( $a['arve_link'], 'arve_link' );
128
+ $a['loop'] = arve_validate_bool( $a['loop'], 'loop' );
129
+ $a['controls'] = arve_validate_bool( $a['controls'], 'controls' );
130
+ $a['sandbox'] = arve_validate_bool( $a['sandbox'], 'sandbox' );
131
+ $a['muted'] = arve_validate_bool( $a['muted'], 'muted' );
132
+ $a['playsinline'] = arve_validate_bool( $a['playsinline'], 'playsinline' );
133
 
134
+ $a['maxwidth'] = (int) $a['maxwidth'];
135
+ $a['maxwidth'] = (int) arve_maxwidth_when_aligned( $a['maxwidth'], $a['align'] );
136
 
137
  $a['id'] = arve_id_fixes( $a['id'], $a['provider'] );
138
 
174
  function arve_sc_filter_missing_attribute_check( $atts ) {
175
 
176
  # Old shortcodes
177
+ if ( ! array_key_exists( 'url', $atts ) ) {
178
  return $atts;
179
  }
180
 
183
 
184
  $array = array_intersect_key( $atts, array_flip( $required_attributes ) );
185
 
186
+ if ( count( array_filter( $array ) ) !== count( $array ) ) {
187
 
188
+ $atts['missing_atts_error'] = arve_error(
189
+ sprintf(
190
+ esc_html__( 'The [arve] shortcode needs one of this attributes %s', ARVE_SLUG ),
191
+ implode( $required_attributes )
192
+ )
193
  );
194
  }
195
 
202
  return $atts;
203
  }
204
 
205
+ if ( is_numeric( $atts['thumbnail'] ) ) {
206
 
207
  $attchment_id = $atts['thumbnail'];
208
 
211
 
212
  } elseif ( arve_validate_url( $atts['thumbnail'] ) ) {
213
 
214
+ $atts['img_src'] = $atts['thumbnail'];
 
215
 
216
  } else {
217
 
227
 
228
  foreach ( $html5_ext as $ext ) {
229
 
230
+ if ( ! empty( $atts[ $ext ] ) && is_numeric( $atts[ $ext ] ) ) {
231
  $atts[ $ext ] = wp_get_attachment_url( $atts[ $ext ] );
232
  }
233
  }
258
  foreach ( $matches as $key => $value ) {
259
 
260
  if ( is_string( $key ) ) {
261
+ $atts['provider'] = $host_id;
262
+ $atts[ $key ] = $matches[ $key ];
263
  }
264
  }
265
 
270
 
271
  function arve_sc_filter_detect_query_args( $atts ) {
272
 
273
+ if ( empty( $atts['url'] ) ) {
274
  return $atts;
275
  }
276
 
280
 
281
  foreach ( $to_extract as $provider => $parameters ) {
282
 
283
+ if ( $provider !== $atts['provider'] ) {
284
  return $atts;
285
  }
286
 
290
 
291
  $att_name = $atts['provider'] . "_$parameter";
292
 
293
+ if ( empty( $query_array[ $parameter ] ) ) {
294
  $atts[ $att_name ] = new WP_Error( $att_name, "$parameter not found in URL" );
295
  } else {
296
  $atts[ $att_name ] = $query_array[ $parameter ];
303
 
304
  function arve_sc_filter_detect_youtube_playlist( $atts ) {
305
 
306
+ if (
307
+ 'youtube' !== $atts['provider'] ||
308
  ( empty( $atts['url'] ) && empty( $atts['id'] ) )
309
  ) {
310
  return $atts;
311
  }
312
 
313
+ if ( empty( $atts['url'] ) ) {
314
  # Not a url but it will work
315
  $url = str_replace( array( '&list=', '&amp;list=' ), '?list=', $atts['id'] );
316
  } else {
319
 
320
  $query_array = arve_url_query_array( $url );
321
 
322
+ if ( empty( $query_array['list'] ) ) {
323
  return $atts;
324
  }
325
 
334
 
335
  function arve_get_video_type( $ext ) {
336
 
337
+ switch ( $ext ) {
338
  case 'ogv':
339
  case 'ogm':
340
  return 'video/ogg';
 
341
  default:
342
  return 'video/' . $ext;
343
  }
345
 
346
  function arve_sc_filter_detect_html5( $atts ) {
347
 
348
+ if ( ! empty( $atts['provider'] ) && 'html5' !== $atts['provider'] ) {
349
  return $atts;
350
  }
351
 
370
  }
371
 
372
  $atts['video_src'] = $atts['url'];
 
 
 
 
 
 
 
373
  }
374
 
375
  endforeach;
376
 
377
+ if ( empty( $atts['video_src'] ) && empty( $atts['video_sources_html'] ) ) {
378
  return $atts;
379
  }
380
 
399
 
400
  function arve_sc_filter_build_tracks_html( $atts ) {
401
 
402
+ if ( 'html5' !== $atts['provider'] ) {
403
  return $atts;
404
  }
405
 
428
  'srclang' => $matches['lang'],
429
  );
430
 
431
+ $atts['video_tracks_html'] .= sprintf( '<track%s>', arve_attr( $attr ) );
432
  }
433
 
434
  return $atts;
public/functions-shortcodes.php CHANGED
@@ -79,8 +79,8 @@ function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = tr
79
  );
80
 
81
  for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
82
- $pairs["track_{$n}"] = null;
83
- $pairs["track_{$n}_label"] = null;
84
  }
85
 
86
  if ( $arve_shortcode ) {
@@ -94,9 +94,10 @@ function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = tr
94
  }
95
  }
96
 
97
- $atts = shortcode_atts( apply_filters( 'arve_shortcode_pairs', $pairs ), $input_atts, 'arve' );
 
98
 
99
- if ( $errors = arve_output_errors( $atts ) ) {
100
  return $errors . arve_get_debug_info( '', $atts, $input_atts );
101
  }
102
 
@@ -134,7 +135,7 @@ function arve_create_shortcodes() {
134
 
135
  $options = arve_get_options();
136
 
137
- foreach( $options['shortcodes'] as $provider => $shortcode ) {
138
 
139
  $function = function( $atts ) use ( $provider ) {
140
  $atts['provider'] = $provider;
@@ -187,7 +188,7 @@ function arve_shortcode_arve_supported() {
187
  $out .= sprintf( '<td>%s</td>', ( isset( $values['requires_src'] ) && $values['requires_src'] ) ? '&#x2713;' : '' );
188
  $out .= sprintf( '<td>%s</td>', ( isset( $values['embed_url'] ) && arve_starts_with( $values['embed_url'], 'https' ) ) ? '&#x2713;' : '' );
189
  $out .= sprintf( '<td>%s</td>', ( isset( $values['auto_thumbnail'] ) && $values['auto_thumbnail'] ) ? '&#x2713;' : '' );
190
- $out .= sprintf( '<td>%s</td>', ( isset( $values['auto_title'] ) && $values['auto_title'] ) ? '&#x2713;' : '' );
191
  $out .= '</tr>';
192
  }
193
 
@@ -202,7 +203,7 @@ function arve_shortcode_arve_supported() {
202
 
203
  function arve_shortcode_arve_supported_list() {
204
 
205
- $list = '';
206
  $providers = arve_get_host_properties();
207
  // unset deprecated and doubled
208
  unset( $providers['dailymotionlist'] );
@@ -212,14 +213,14 @@ function arve_shortcode_arve_supported_list() {
212
  $list .= '* ' . $values['name'] . PHP_EOL;
213
  }
214
 
215
- return '<textarea style="width:100%" rows="15">'. $list . '</textarea>';
216
  }
217
 
218
  function arve_shortcode_arve_params() {
219
 
220
  $attrs = arve_get_settings_definitions();
221
 
222
- if( function_exists( 'arve_pro_get_settings_definitions' ) ) {
223
  $attrs = array_merge( $attrs, arve_pro_get_settings_definitions() );
224
  }
225
 
@@ -231,7 +232,7 @@ function arve_shortcode_arve_params() {
231
 
232
  foreach ( $attrs as $key => $values ) {
233
 
234
- if( isset( $values['hide_from_sc'] ) && $values['hide_from_sc'] ) {
235
  continue;
236
  }
237
 
@@ -241,11 +242,11 @@ function arve_shortcode_arve_params() {
241
 
242
  if ( ! empty( $values['options'] ) ) {
243
 
244
- foreach ( $values['options'] as $key => $value) {
245
  $choices[] = sprintf( '<code>%s</code>', $key );
246
  }
247
 
248
- $desc .= __('Options: ', ARVE_SLUG ) . implode( ', ', $choices ) . '<br>';
249
  }
250
 
251
  if ( ! empty( $values['description'] ) ) {
@@ -271,11 +272,11 @@ function arve_wp_video_shortcode_override( $out, $attr, $content, $instance ) {
271
 
272
  $options = arve_get_options();
273
 
274
- if( ! $options['wp_video_override'] || ! empty( $attr['wmv'] ) || ! empty( $attr['flv'] ) ) {
275
  return $out;
276
  }
277
 
278
- if( ! empty( $attr['poster'] ) ) {
279
  $attr['thumbnail'] = $attr['poster'];
280
  }
281
 
79
  );
80
 
81
  for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
82
+ $pairs[ "track_{$n}" ] = null;
83
+ $pairs[ "track_{$n}_label" ] = null;
84
  }
85
 
86
  if ( $arve_shortcode ) {
94
  }
95
  }
96
 
97
+ $atts = shortcode_atts( apply_filters( 'arve_shortcode_pairs', $pairs ), $input_atts, 'arve' );
98
+ $errors = arve_output_errors( $atts );
99
 
100
+ if ( $errors ) {
101
  return $errors . arve_get_debug_info( '', $atts, $input_atts );
102
  }
103
 
135
 
136
  $options = arve_get_options();
137
 
138
+ foreach ( $options['shortcodes'] as $provider => $shortcode ) {
139
 
140
  $function = function( $atts ) use ( $provider ) {
141
  $atts['provider'] = $provider;
188
  $out .= sprintf( '<td>%s</td>', ( isset( $values['requires_src'] ) && $values['requires_src'] ) ? '&#x2713;' : '' );
189
  $out .= sprintf( '<td>%s</td>', ( isset( $values['embed_url'] ) && arve_starts_with( $values['embed_url'], 'https' ) ) ? '&#x2713;' : '' );
190
  $out .= sprintf( '<td>%s</td>', ( isset( $values['auto_thumbnail'] ) && $values['auto_thumbnail'] ) ? '&#x2713;' : '' );
191
+ $out .= sprintf( '<td>%s</td>', ( isset( $values['auto_title'] ) && $values['auto_title'] ) ? '&#x2713;' : '' );
192
  $out .= '</tr>';
193
  }
194
 
203
 
204
  function arve_shortcode_arve_supported_list() {
205
 
206
+ $list = '';
207
  $providers = arve_get_host_properties();
208
  // unset deprecated and doubled
209
  unset( $providers['dailymotionlist'] );
213
  $list .= '* ' . $values['name'] . PHP_EOL;
214
  }
215
 
216
+ return '<textarea style="width:100%" rows="15">' . $list . '</textarea>';
217
  }
218
 
219
  function arve_shortcode_arve_params() {
220
 
221
  $attrs = arve_get_settings_definitions();
222
 
223
+ if ( function_exists( 'arve_pro_get_settings_definitions' ) ) {
224
  $attrs = array_merge( $attrs, arve_pro_get_settings_definitions() );
225
  }
226
 
232
 
233
  foreach ( $attrs as $key => $values ) {
234
 
235
+ if ( isset( $values['hide_from_sc'] ) && $values['hide_from_sc'] ) {
236
  continue;
237
  }
238
 
242
 
243
  if ( ! empty( $values['options'] ) ) {
244
 
245
+ foreach ( $values['options'] as $key => $value ) {
246
  $choices[] = sprintf( '<code>%s</code>', $key );
247
  }
248
 
249
+ $desc .= __( 'Options: ', ARVE_SLUG ) . implode( ', ', $choices ) . '<br>';
250
  }
251
 
252
  if ( ! empty( $values['description'] ) ) {
272
 
273
  $options = arve_get_options();
274
 
275
+ if ( ! $options['wp_video_override'] || ! empty( $attr['wmv'] ) || ! empty( $attr['flv'] ) ) {
276
  return $out;
277
  }
278
 
279
+ if ( ! empty( $attr['poster'] ) ) {
280
  $attr['thumbnail'] = $attr['poster'];
281
  }
282
 
public/functions-thumbnails.php CHANGED
@@ -2,11 +2,13 @@
2
 
3
  function arve_get_attachment_image_url_or_srcset( $url_or_srcset, $thumbnail ) {
4
 
5
- if( $found = arve_get_cached_attachment_image_url_or_srcset( $url_or_srcset, $thumbnail ) ) {
 
 
6
 
7
  return $found;
8
 
9
- } elseif ( 'url' == $url_or_srcset ) {
10
 
11
  return new WP_Error( 'wp thumbnail', __( 'No attachment with that ID', ARVE_SLUG ) );
12
 
@@ -23,13 +25,13 @@ function arve_get_cached_attachment_image_url_or_srcset( $url_or_srcset, $attach
23
  $transient = get_transient( $transient_name );
24
  $time = (int) $options['wp_image_cache_time'];
25
 
26
- if( false === $transient || $time <= 0 ) {
27
 
28
- if( 'srcset' == $url_or_srcset ) {
29
 
30
  $out = wp_get_attachment_image_srcset( $attachment_id, 'small' );
31
 
32
- } elseif( 'url' == $url_or_srcset ) {
33
 
34
  $out = wp_get_attachment_image_url( $attachment_id, 'small' );
35
  }
2
 
3
  function arve_get_attachment_image_url_or_srcset( $url_or_srcset, $thumbnail ) {
4
 
5
+ $found = arve_get_cached_attachment_image_url_or_srcset( $url_or_srcset, $thumbnail );
6
+
7
+ if ( $found ) {
8
 
9
  return $found;
10
 
11
+ } elseif ( 'url' === $url_or_srcset ) {
12
 
13
  return new WP_Error( 'wp thumbnail', __( 'No attachment with that ID', ARVE_SLUG ) );
14
 
25
  $transient = get_transient( $transient_name );
26
  $time = (int) $options['wp_image_cache_time'];
27
 
28
+ if ( false === $transient || $time <= 0 ) {
29
 
30
+ if ( 'srcset' === $url_or_srcset ) {
31
 
32
  $out = wp_get_attachment_image_srcset( $attachment_id, 'small' );
33
 
34
+ } elseif ( 'url' === $url_or_srcset ) {
35
 
36
  $out = wp_get_attachment_image_url( $attachment_id, 'small' );
37
  }
public/functions-url-handlers.php CHANGED
@@ -23,8 +23,10 @@ function arve_url_detection_to_shortcode( $provider, $matches, $attr, $url, $raw
23
  $url = substr( $url, 0, -4 );
24
  }
25
 
26
- $parsed_url = parse_url( $url );
27
- $url_query = $old_atts = $new_atts = array();
 
 
28
 
29
  if ( ! empty( $parsed_url['query'] ) ) {
30
  parse_str( $parsed_url['query'], $url_query );
@@ -33,7 +35,7 @@ function arve_url_detection_to_shortcode( $provider, $matches, $attr, $url, $raw
33
  foreach ( $url_query as $key => $value ) {
34
 
35
  if ( arve_starts_with( $key, 'arve-' ) ) {
36
- $key = substr( $key, 5 );
37
  $old_atts[ $key ] = $value;
38
  }
39
  }
@@ -50,7 +52,7 @@ function arve_url_detection_to_shortcode( $provider, $matches, $attr, $url, $raw
50
 
51
  unset( $url_query['arve'] );
52
 
53
- if ( 'youtube' == $provider ) {
54
  unset( $url_query['v'] );
55
  unset( $url_query['t'] );
56
  }
@@ -65,23 +67,25 @@ function arve_url_detection_to_shortcode( $provider, $matches, $attr, $url, $raw
65
 
66
 
67
  /**
68
- * Remove the Wordpress default Oembed support for video providers that ARVE Supports. Array taken from wp-includes/class-oembed.php __construct
69
  *
70
  * @since 5.9.9
71
  *
72
  */
73
  function arve_oembed_remove_providers() {
74
 
 
 
75
  $wp_core_oembed_shits = array(
76
- '#http://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ),
77
- '#https://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
78
  #'#http://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed', true ),
79
  #'#https://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
80
- '#http://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed', true ),
81
- '#https://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
82
- '#https?://(.+\.)?vimeo\.com/.*#i' => array( 'http://vimeo.com/api/oembed.{format}', true ),
83
- '#https?://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/services/oembed', true ),
84
- 'http://dai.ly/*' => array( 'http://www.dailymotion.com/services/oembed', false ),
85
  #'#https?://(www\.)?flickr\.com/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
86
  #'#https?://flic\.kr/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
87
  #'#https?://(.+\.)?smugmug\.com/.*#i' => array( 'http://api.smugmug.com/services/oembed/', true ),
@@ -93,9 +97,9 @@ function arve_oembed_remove_providers() {
93
  #'#https?://wordpress.tv/.*#i' => array( 'http://wordpress.tv/oembed/', true ),
94
  #'#https?://(.+\.)?polldaddy\.com/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
95
  #'#https?://poll\.fm/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
96
- '#https?://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ),
97
  #'#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' => array( 'https://api.twitter.com/1/statuses/oembed.{format}', true ),
98
- '#https?://vine.co/v/.*#i' => array( 'https://vine.co/oembed.{format}', true ),
99
  #'#https?://(www\.)?soundcloud\.com/.*#i' => array( 'http://soundcloud.com/oembed', true ),
100
  #'#https?://(.+?\.)?slideshare\.net/.*#i' => array( 'https://www.slideshare.net/api/oembed/2', true ),
101
  #'#http://instagr(\.am|am\.com)/p/.*#i' => array( 'http://api.instagram.com/oembed', true ),
@@ -105,13 +109,13 @@ function arve_oembed_remove_providers() {
105
  #'#https?://(.+\.)?imgur\.com/.*#i' => array( 'http://api.imgur.com/oembed', true ),
106
  #'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i' => array( 'http://api.meetup.com/oembed', true ),
107
  #'#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'http://issuu.com/oembed_wp', true ),
108
- '#https?://(www\.)?collegehumor\.com/video/.*#i' => array( 'http://www.collegehumor.com/oembed.{format}', true ),
109
  #'#https?://(www\.)?mixcloud\.com/.*#i' => array( 'http://www.mixcloud.com/oembed', true ),
110
- '#https?://(www\.|embed\.)?ted\.com/talks/.*#i' => array( 'http://www.ted.com/talks/oembed.{format}', true ),
111
  #'#https?://(www\.)?(animoto|video214)\.com/play/.*#i' => array( 'http://animoto.com/oembeds/create', true ),
112
  );
113
 
114
- foreach( $wp_core_oembed_shits as $shit => $fuck ) {
115
 
116
  wp_oembed_remove_provider( $shit );
117
  }
@@ -127,7 +131,7 @@ function arve_oembed_remove_providers() {
127
  wp_embed_unregister_handler( 'jetpack_vine' );
128
  remove_shortcode( 'vine', 'vine_shortcode' );
129
 
130
- remove_filter('pre_kses', 'youtube_embed_to_short_code');
131
  remove_shortcode( 'youtube', 'youtube_shortcode' );
132
 
133
  remove_shortcode( 'ted', 'shortcode_ted' );
23
  $url = substr( $url, 0, -4 );
24
  }
25
 
26
+ $parsed_url = wp_parse_url( $url );
27
+ $url_query = array();
28
+ $old_atts = array();
29
+ $new_atts = array();
30
 
31
  if ( ! empty( $parsed_url['query'] ) ) {
32
  parse_str( $parsed_url['query'], $url_query );
35
  foreach ( $url_query as $key => $value ) {
36
 
37
  if ( arve_starts_with( $key, 'arve-' ) ) {
38
+ $key = substr( $key, 5 );
39
  $old_atts[ $key ] = $value;
40
  }
41
  }
52
 
53
  unset( $url_query['arve'] );
54
 
55
+ if ( 'youtube' === $provider ) {
56
  unset( $url_query['v'] );
57
  unset( $url_query['t'] );
58
  }
67
 
68
 
69
  /**
70
+ * Remove the WordPress default Oembed support for video providers that ARVE Supports. Array taken from wp-includes/class-oembed.php __construct
71
  *
72
  * @since 5.9.9
73
  *
74
  */
75
  function arve_oembed_remove_providers() {
76
 
77
+ // phpcs:disable Squiz.PHP.CommentedOutCode.Found
78
+
79
  $wp_core_oembed_shits = array(
80
+ '#http://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ),
81
+ '#https://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
82
  #'#http://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed', true ),
83
  #'#https://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
84
+ '#http://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed', true ),
85
+ '#https://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
86
+ '#https?://(.+\.)?vimeo\.com/.*#i' => array( 'http://vimeo.com/api/oembed.{format}', true ),
87
+ '#https?://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/services/oembed', true ),
88
+ 'http://dai.ly/*' => array( 'http://www.dailymotion.com/services/oembed', false ),
89
  #'#https?://(www\.)?flickr\.com/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
90
  #'#https?://flic\.kr/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
91
  #'#https?://(.+\.)?smugmug\.com/.*#i' => array( 'http://api.smugmug.com/services/oembed/', true ),
97
  #'#https?://wordpress.tv/.*#i' => array( 'http://wordpress.tv/oembed/', true ),
98
  #'#https?://(.+\.)?polldaddy\.com/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
99
  #'#https?://poll\.fm/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
100
+ '#https?://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ),
101
  #'#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' => array( 'https://api.twitter.com/1/statuses/oembed.{format}', true ),
102
+ '#https?://vine.co/v/.*#i' => array( 'https://vine.co/oembed.{format}', true ),
103
  #'#https?://(www\.)?soundcloud\.com/.*#i' => array( 'http://soundcloud.com/oembed', true ),
104
  #'#https?://(.+?\.)?slideshare\.net/.*#i' => array( 'https://www.slideshare.net/api/oembed/2', true ),
105
  #'#http://instagr(\.am|am\.com)/p/.*#i' => array( 'http://api.instagram.com/oembed', true ),
109
  #'#https?://(.+\.)?imgur\.com/.*#i' => array( 'http://api.imgur.com/oembed', true ),
110
  #'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i' => array( 'http://api.meetup.com/oembed', true ),
111
  #'#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'http://issuu.com/oembed_wp', true ),
112
+ '#https?://(www\.)?collegehumor\.com/video/.*#i' => array( 'http://www.collegehumor.com/oembed.{format}', true ),
113
  #'#https?://(www\.)?mixcloud\.com/.*#i' => array( 'http://www.mixcloud.com/oembed', true ),
114
+ '#https?://(www\.|embed\.)?ted\.com/talks/.*#i' => array( 'http://www.ted.com/talks/oembed.{format}', true ),
115
  #'#https?://(www\.)?(animoto|video214)\.com/play/.*#i' => array( 'http://animoto.com/oembeds/create', true ),
116
  );
117
 
118
+ foreach ( $wp_core_oembed_shits as $shit => $fuck ) {
119
 
120
  wp_oembed_remove_provider( $shit );
121
  }
131
  wp_embed_unregister_handler( 'jetpack_vine' );
132
  remove_shortcode( 'vine', 'vine_shortcode' );
133
 
134
+ remove_filter( 'pre_kses', 'youtube_embed_to_short_code' );
135
  remove_shortcode( 'youtube', 'youtube_shortcode' );
136
 
137
  remove_shortcode( 'ted', 'shortcode_ted' );
public/functions-validation.php CHANGED
@@ -25,7 +25,8 @@ function arve_validate_aspect_ratio( $aspect_ratio ) {
25
  return $aspect_ratio;
26
  }
27
 
28
- return new WP_Error( 'Aspect ratio',
 
29
  sprintf( __( 'Aspect ratio <code>%s</code> is not valid', ARVE_SLUG ), $aspect_ratio )
30
  );
31
  }
@@ -48,22 +49,19 @@ function arve_validate_bool( $val, $name ) {
48
  case 'yes':
49
  case 'on':
50
  return true;
51
- break;
52
- case null;
53
  return null;
54
- break;
55
  case 'false':
56
  case '0':
57
  case 'n':
58
  case 'no':
59
  case 'off':
60
  return false;
61
- break;
62
  default:
63
- return new WP_Error( $name,
64
- sprintf( __( '%s <code>%s</code> not valid', ARVE_SLUG ), $name, $val )
 
65
  );
66
- break;
67
  }
68
  }
69
 
@@ -89,11 +87,11 @@ function arve_validate_align( $align ) {
89
 
90
  function arve_validate_mode( $mode, $provider ) {
91
 
92
- if ( 'thumbnail' == $mode ) {
93
  $mode = 'lazyload-lightbox';
94
  }
95
 
96
- if ( 'veoh' == $mode ) {
97
  $mode = 'normal';
98
  }
99
 
@@ -101,11 +99,6 @@ function arve_validate_mode( $mode, $provider ) {
101
 
102
  if ( ! array_key_exists( $mode, $supported_modes ) ) {
103
 
104
- #$mode = new WP_Error( 'mode', sprintf(
105
- # __( 'Mode: <code>%s</code> is invalid or not supported. Note that you will need the Pro Addon activated for modes other than normal.', ARVE_SLUG ),
106
- # esc_html( $mode )
107
- #) );
108
-
109
  $mode = 'normal';
110
  }
111
 
25
  return $aspect_ratio;
26
  }
27
 
28
+ return new WP_Error(
29
+ 'Aspect ratio',
30
  sprintf( __( 'Aspect ratio <code>%s</code> is not valid', ARVE_SLUG ), $aspect_ratio )
31
  );
32
  }
49
  case 'yes':
50
  case 'on':
51
  return true;
52
+ case null:
 
53
  return null;
 
54
  case 'false':
55
  case '0':
56
  case 'n':
57
  case 'no':
58
  case 'off':
59
  return false;
 
60
  default:
61
+ return new WP_Error(
62
+ $name,
63
+ sprintf( __( '%1$s <code>%2$s</code> not valid', ARVE_SLUG ), $name, $val )
64
  );
 
65
  }
66
  }
67
 
87
 
88
  function arve_validate_mode( $mode, $provider ) {
89
 
90
+ if ( 'thumbnail' === $mode ) {
91
  $mode = 'lazyload-lightbox';
92
  }
93
 
94
+ if ( 'veoh' === $mode ) {
95
  $mode = 'normal';
96
  }
97
 
99
 
100
  if ( ! array_key_exists( $mode, $supported_modes ) ) {
101
 
 
 
 
 
 
102
  $mode = 'normal';
103
  }
104
 
public/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: YouTube, Vimeo, lazyload, thumbnail, video, responsive, embeds, video-embe
5
  Requires at least: 4.4.0
6
  Tested up to: 5.2.2
7
  Requires PHP: 5.3
8
- Stable tag: 8.10.10
9
  License: GPL-3.0
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -158,6 +158,14 @@ This plugins embed is considered as 'custom player' by YouTube so you have to pa
158
  * [ARVE Pro addon changelog](https://nextgenthemes.com/plugins/arve-pro/changelog/)
159
  * [ARVE AMP addon changelog](https://nextgenthemes.com/plugins/arve-amp/)
160
 
 
 
 
 
 
 
 
 
161
  ### 2019-08-29 - 8.10.10 ###
162
 
163
  Just a small readme update and checking new release script, making sure everything works and everyone is on the latest stable version.
5
  Requires at least: 4.4.0
6
  Tested up to: 5.2.2
7
  Requires PHP: 5.3
8
+ Stable tag: 8.10.12
9
  License: GPL-3.0
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
158
  * [ARVE Pro addon changelog](https://nextgenthemes.com/plugins/arve-pro/changelog/)
159
  * [ARVE AMP addon changelog](https://nextgenthemes.com/plugins/arve-amp/)
160
 
161
+ ### 2019-10-01 - 8.10.12 ###
162
+
163
+ * Improved: Allow for manually srcset with `img_srcset` with the Pro Addon.
164
+
165
+ ### 2019-08-29 - 8.10.11 ###
166
+
167
+ * Removed vendor dir from Git versioning.
168
+
169
  ### 2019-08-29 - 8.10.10 ###
170
 
171
  Just a small readme update and checking new release script, making sure everything works and everyone is on the latest stable version.
shared/functions-shared.php CHANGED
@@ -44,13 +44,13 @@ function arve_get_options() {
44
  $supported_modes = arve_get_supported_modes();
45
 
46
  # legacy mode name
47
- if ( 'thumbnail' == $options['mode'] ) {
48
 
49
  $options['mode'] = 'lazyload';
50
  update_option( 'arve_options_main', $options );
51
  }
52
 
53
- if( ! in_array( $options['mode'], array( 'normal', 'lazyload', 'lazyload-lightbox', 'link-lightbox' ) ) ) {
54
 
55
  $options['mode'] = 'lazyload';
56
  update_option( 'arve_options_main', $options );
@@ -70,22 +70,22 @@ function arve_get_settings_definitions() {
70
 
71
  foreach ( $properties as $provider => $values ) {
72
 
73
- if( ! empty( $values['auto_thumbnail'] ) ) {
74
  $auto_thumbs[] = $values['name'];
75
  }
76
- if( ! empty( $values['auto_title'] ) ) {
77
  $auto_title[] = $values['name'];
78
  }
79
- if( ! empty( $values['requires_src'] ) ) {
80
  $embed_code_only[] = $values['name'];
81
  }
82
  }
83
 
84
- $auto_thumbs = implode( ', ', $auto_thumbs );
85
- $auto_title = implode( ', ', $auto_title );
86
- $embed_code_only = implode( ', ', $embed_code_only );
87
 
88
- if ( in_array( $options['mode'], $supported_modes ) ) {
89
  $current_mode_name = $supported_modes[ $options['mode'] ];
90
  } else {
91
  $current_mode_name = $options['mode'];
@@ -94,14 +94,14 @@ function arve_get_settings_definitions() {
94
  $definitions = array(
95
  array(
96
  'hide_from_settings' => true,
97
- 'attr' => 'url',
98
- 'label' => esc_html__( 'URL / Embed Code', ARVE_SLUG ),
99
- 'type' => 'text',
100
- 'meta' => array(
101
  'placeholder' => esc_attr__( 'Video URL / iframe Embed Code', ARVE_SLUG ),
102
  ),
103
- 'description' => sprintf(
104
- __( 'Post the URL of the video here. For %s and any <a href="%s">unlisted</a> video hosts paste their iframe embed codes or its src URL in here (providers embeds need to be responsive).', ARVE_SLUG ),
105
  $embed_code_only,
106
  'https://nextgenthemes.com/arve-pro/#video-host-support'
107
  )
@@ -115,11 +115,11 @@ function arve_get_settings_definitions() {
115
  arve_get_supported_modes(),
116
  ),
117
  array(
118
- 'attr' => 'align',
119
- 'label' => esc_html__('Alignment', ARVE_SLUG ),
120
- 'type' => 'select',
121
  'options' => array(
122
- '' => sprintf( esc_html__( 'Default (current setting: %s)', ARVE_SLUG ), $options['align'] ),
123
  'none' => esc_html__( 'None', ARVE_SLUG ),
124
  'left' => esc_html__( 'Left', ARVE_SLUG ),
125
  'right' => esc_html__( 'Right', ARVE_SLUG ),
@@ -127,67 +127,67 @@ function arve_get_settings_definitions() {
127
  ),
128
  ),
129
  array(
130
- 'attr' => 'promote_link',
131
- 'label' => esc_html__( 'ARVE Link', ARVE_SLUG ),
132
- 'type' => 'select',
133
- 'options' => array(
134
- '' => sprintf(
135
  __( 'Default (current setting: %s)', ARVE_SLUG ),
136
  ( $options['promote_link'] ) ? esc_html__( 'Yes', ARVE_SLUG ) : esc_html__( 'No', ARVE_SLUG )
137
  ),
138
  'yes' => esc_html__( 'Yes', ARVE_SLUG ),
139
  'no' => esc_html__( 'No', ARVE_SLUG ),
140
  ),
141
- 'description' => esc_html__( "Shows a small 'ARVE' link below the videos. Be the most awesome person and help promoting this plugin.", ARVE_SLUG ),
142
  ),
143
  array(
144
  'hide_from_settings' => true,
145
- 'attr' => 'thumbnail',
146
- 'label' => esc_html__( 'Thumbnail', ARVE_SLUG ),
147
- 'type' => 'attachment',
148
- 'libraryType' => array( 'image' ),
149
- 'addButton' => esc_html__( 'Select Image', ARVE_SLUG ),
150
- 'frameTitle' => esc_html__( 'Select Image', ARVE_SLUG ),
151
- 'description' => sprintf( esc_html__( 'Preview image for Lazyload modes, always used for SEO. The Pro Addon is able to get them from %s automatically.', ARVE_SLUG ), $auto_thumbs ),
152
  ),
153
  array(
154
  'hide_from_settings' => true,
155
- 'attr' => 'title',
156
- 'label' => esc_html__('Title', ARVE_SLUG),
157
- 'type' => 'text',
158
- 'description' => sprintf( esc_html__( 'Used for SEO, is visible on top of thumbnails in Lazyload modes, is used as link text in link-lightbox mode. The Pro Addon is able to get them from %s automatically.', ARVE_SLUG ), $auto_title ),
159
  ),
160
  array(
161
  'hide_from_settings' => true,
162
- 'attr' => 'description',
163
- 'label' => esc_html__('Description', ARVE_SLUG),
164
- 'type' => 'text',
165
- 'meta' => array(
166
  'placeholder' => __( 'Description for SEO', ARVE_SLUG ),
167
  )
168
  ),
169
  array(
170
  'hide_from_settings' => true,
171
- 'attr' => 'upload_date',
172
- 'label' => esc_html__( 'Upload Date', ARVE_SLUG ),
173
- 'type' => 'text',
174
- 'meta' => array(
175
  'placeholder' => __( 'Upload Date for SEO, ISO 8601 format', ARVE_SLUG ),
176
  )
177
  ),
178
  array(
179
  'hide_from_settings' => true,
180
- 'attr' => 'duration',
181
- 'label' => esc_html__( 'Duration', ARVE_SLUG ),
182
- 'type' => 'text',
183
- 'description' => __( 'Duration in this format. <code>1HJ2M3S</code> for 1 hour, 2 minutes and 3 seconds. <code>5M</code> for 5 minutes.', ARVE_SLUG ),
184
  ),
185
  array(
186
- 'attr' => 'autoplay',
187
- 'label' => esc_html__('Autoplay', ARVE_SLUG ),
188
- 'type' => 'select',
189
- 'options' => array(
190
- '' => sprintf(
191
  __( 'Default (current setting: %s)', ARVE_SLUG ),
192
  ( $options['autoplay'] ) ? esc_html__( 'Yes', ARVE_SLUG ) : esc_html__( 'No', ARVE_SLUG )
193
  ),
@@ -197,48 +197,48 @@ function arve_get_settings_definitions() {
197
  'description' => esc_html__( 'Autoplay videos in normal mode, has no effect on lazyload modes.', ARVE_SLUG ),
198
  ),
199
  array(
200
- 'hide_from_sc' => true,
201
- 'attr' => 'video_maxwidth',
202
- 'label' => esc_html__('Maximal Width', ARVE_SLUG),
203
- 'type' => 'number',
204
- 'description' => __( 'Maximal size your videos can be displayed, if set to 0 it will default to your themes <code>$content_width</code>.', ARVE_SLUG ),
205
  ),
206
  array(
207
  'hide_from_settings' => true,
208
- 'attr' => 'maxwidth',
209
- 'label' => esc_html__('Maximal Width', ARVE_SLUG),
210
- 'type' => 'number',
211
- 'meta' => array(
212
- 'placeholder' => esc_attr__( 'in px - leave empty to use settings', ARVE_SLUG),
213
  ),
214
  ),
215
  array(
216
- 'hide_from_sc' => true,
217
- 'attr' => 'align_maxwidth',
218
- 'label' => esc_html__('Align Maximal Width', ARVE_SLUG),
219
- 'type' => 'number',
220
- 'description' => esc_attr__( 'In px, Needed! Must be 100+ to work.', ARVE_SLUG ),
221
  ),
222
  array(
223
  'hide_from_settings' => true,
224
- 'attr' => 'aspect_ratio',
225
- 'label' => __('Aspect Ratio', ARVE_SLUG),
226
- 'type' => 'text',
227
- 'meta' => array(
228
- 'placeholder' => __( 'Custom aspect ratio like 4:3, 21:9 ... Leave empty for default.', ARVE_SLUG),
229
  ),
230
  ),
231
  array(
232
  'hide_from_settings' => true,
233
- 'attr' => 'parameters',
234
- 'label' => esc_html__('Parameters', ARVE_SLUG ),
235
- 'type' => 'text',
236
- 'meta' => array(
237
  'placeholder' => __( 'provider specific parameters', ARVE_SLUG ),
238
  ),
239
- 'description' => sprintf(
240
  __(
241
- 'Note this values get merged with values set on the <a target="_blank" href="%s">ARVE setting page</a>. Example for YouTube <code>fs=0&start=30</code>. For reference: <a target="_blank" href="%s">Youtube Parameters</a>, <a target="_blank" href="%s">Dailymotion Parameters</a>, <a target="_blank" href="%s">Vimeo Parameters</a>.',
242
  ARVE_SLUG
243
  ),
244
  admin_url( 'admin.php?page=advanced-responsive-video-embedder' ),
@@ -250,88 +250,82 @@ function arve_get_settings_definitions() {
250
  ),
251
  array(
252
  'hide_from_sc' => true,
253
- 'attr' => 'wp_image_cache_time',
254
- 'label' => esc_html__('Image Cache Time', ARVE_SLUG),
255
- 'type' => 'number',
256
- 'description' => __( '(seconds) This plugin uses WordPress transients to cache video thumbnail URLS. This setting defines how long image URLs from the media Gallery are being stored before running WPs fuctions again to request them. For example: hour - 3600, day - 86400, week - 604800.', ARVE_SLUG ),
257
  ),
258
  array(
259
  'hide_from_sc' => true,
260
- 'attr' => 'wp_video_override',
261
- 'label' => esc_html__( 'Use ARVE for HTML5 video embeds', ARVE_SLUG ),
262
- 'type' => 'select',
263
- 'options' => array(
264
  'yes' => esc_html__( 'Yes', ARVE_SLUG ),
265
  'no' => esc_html__( 'No', ARVE_SLUG ),
266
  ),
267
- 'description' => esc_html__( "Use ARVE to embed HTML5 video files. ARVE uses the browsers players instead of loading the mediaelement player that WP uses.", ARVE_SLUG ),
268
  ),
269
  array(
270
- 'attr' => 'controlslist',
271
- 'label' => esc_html__( 'Chrome HTML5 Player controls', ARVE_SLUG ),
272
- 'type' => 'text',
273
- 'description' => __( "controlsList attribute on &lt;video&gt; for example use <code>nodownload nofullscreen noremoteplayback</code> to hide the download and the fullscreen button on the chrome HTML5 video player and disable remote playback.", ARVE_SLUG ),
274
  ),
275
  array(
276
  'hide_from_settings' => true,
277
- 'attr' => 'mp4',
278
- 'label' => esc_html__('mp4 file', ARVE_SLUG),
279
- 'type' => 'url',
280
- #'type' => 'attachment',
281
- #'libraryType' => array( 'video' ),
282
- #'addButton' => esc_html__( 'Select .mp4 file', ARVE_SLUG ),
283
- #'frameTitle' => esc_html__( 'Select .mp4 file', ARVE_SLUG ),
284
- 'meta' => array(
285
  'placeholder' => __( '.mp4 file url for HTML5 video', ARVE_SLUG ),
286
  ),
287
  ),
288
  array(
289
  'hide_from_settings' => true,
290
- 'attr' => 'webm',
291
- 'label' => esc_html__('webm file', ARVE_SLUG),
292
- 'type' => 'url',
293
- #'type' => 'attachment',
294
- #'libraryType' => array( 'video' ),
295
- #'addButton' => esc_html__( 'Select .webm file', ARVE_SLUG ),
296
- #'frameTitle' => esc_html__( 'Select .webm file', ARVE_SLUG ),
297
- 'meta' => array(
298
  'placeholder' => __( '.webm file url for HTML5 video', ARVE_SLUG ),
299
  ),
300
  ),
301
  array(
302
  'hide_from_settings' => true,
303
- 'attr' => 'ogv',
304
- 'label' => esc_html__('ogv file', ARVE_SLUG),
305
- 'type' => 'url',
 
306
  #'type' => 'attachment',
307
  #'libraryType' => array( 'video' ),
308
  #'addButton' => esc_html__( 'Select .ogv file', ARVE_SLUG ),
309
  #'frameTitle' => esc_html__( 'Select .ogv file', ARVE_SLUG ),
310
- 'meta' => array(
 
311
  'placeholder' => __( '.ogv file url for HTML5 video', ARVE_SLUG ),
312
  ),
313
  ),
314
  array(
315
  'hide_from_settings' => true,
316
- 'attr' => 'controls',
317
- 'label' => esc_html__( 'Show Controls?', ARVE_SLUG ),
318
- 'type' => 'select',
319
- 'options' => array(
320
- '' => esc_html__( 'Yes', ARVE_SLUG ),
321
- 'no' => esc_html__( 'No', ARVE_SLUG ),
322
  ),
323
- 'description' => esc_html__( 'Show controls on HTML5 video.', ARVE_SLUG ),
324
  ),
325
  array(
326
  'hide_from_settings' => true,
327
- 'attr' => 'loop',
328
- 'label' => esc_html__( 'Loop?', ARVE_SLUG ),
329
- 'type' => 'select',
330
- 'options' => array(
331
  '' => esc_html__( 'No', ARVE_SLUG ),
332
  'yes' => esc_html__( 'Yes', ARVE_SLUG ),
333
  ),
334
- 'description' => esc_html__( 'Loop HTML5 video.', ARVE_SLUG ),
335
  ),
336
  array(
337
  'hide_from_settings' => true,
@@ -339,42 +333,42 @@ function arve_get_settings_definitions() {
339
  'label' => esc_html__( 'Mute?', ARVE_SLUG ),
340
  'type' => 'select',
341
  'options' => array(
342
- '' => esc_html__( 'No', ARVE_SLUG ),
343
- 'yes' => esc_html__( 'Yes', ARVE_SLUG ),
344
  ),
345
  'description' => esc_html__( 'Mute HTML5 video.', ARVE_SLUG ),
346
  ),
347
  array(
348
  'hide_from_sc' => true,
349
- 'attr' => 'always_enqueue_assets',
350
- 'label' => esc_html__( 'Assent loading', ARVE_SLUG ),
351
- 'type' => 'select',
352
- 'options' => array(
353
- 'no' => esc_html__( 'When ARVE video is detected', ARVE_SLUG ),
354
- 'yes' => esc_html__( 'Always', ARVE_SLUG ),
355
  ),
356
- 'description' => sprintf(
357
  __( 'Usually ARVE will loads its scripts and styles only on pages what need them. In case your content is loaded via AJAX or the styles are not loaded for another reason you may have to enable this option', ARVE_SLUG ),
358
  'https://nextgenthemes.com/plugins/arve-pro/#support-table'
359
  ),
360
  ),
361
  array(
362
  'hide_from_sc' => true,
363
- 'attr' => 'youtube_nocookie',
364
- 'label' => esc_html__( 'Use youtube-nocookie.com url?', ARVE_SLUG ),
365
- 'type' => 'select',
366
- 'options' => array(
367
- 'yes' => esc_html__( 'Yes', ARVE_SLUG ),
368
- 'no' => esc_html__( 'No', ARVE_SLUG ),
369
  ),
370
- 'description' => esc_html__( 'Privacy enhanced mode, will NOT disable cookies but only sets them when a user starts to play a video. There is currently a youtube bug that opens highlighed video boxes with a wrong -nocookie.com url so you need to disble this if you need those.' ),
371
  ),
372
  array(
373
- 'hide_from_sc' => true,
374
- 'attr' => 'vimeo_api_token',
375
- 'label' => esc_html__( 'Video API Token', ARVE_SLUG ),
376
- 'type' => 'text',
377
- 'description' => sprintf(
378
  __( 'Needed for <a href="%s">Random Video Addon</a>.', ARVE_SLUG ),
379
  'https://nextgenthemes.local/plugins/arve-random-video/'
380
  ),
@@ -397,7 +391,7 @@ function arve_get_mode_options( $selected ) {
397
 
398
  $out = '';
399
 
400
- foreach( $modes as $mode => $desc ) {
401
 
402
  $out .= sprintf(
403
  '<option value="%s" %s>%s</option>',
@@ -423,96 +417,99 @@ function arve_get_host_properties() {
423
  $s = 'https?://(www\.)?';
424
 
425
  $properties = array(
426
- 'allmyvideos' => array(
427
  'name' => 'allmyvideos.net',
428
  'regex' => $s . 'allmyvideos\.net/(embed-)?(?<id>[a-z0-9]+)',
429
  'embed_url' => 'https://allmyvideos.net/embed-%s.html',
430
- 'tests' => array(
431
  array(
432
  'url' => 'https://allmyvideos.net/1bno5g9il7ha',
433
- 'id' => '1bno5g9il7ha',
434
  ),
435
  array(
436
  'url' => 'https://allmyvideos.net/embed-1bno5g9il7ha.html',
437
- 'id' => '1bno5g9il7ha',
438
  ),
439
  )
440
  ),
441
- 'alugha' => array(
442
- 'regex' => $s . 'alugha\.com/(1/)?videos/(?<id>[a-z0-9_\-]+)',
443
- 'embed_url' => 'https://alugha.com/embed/web-player/?v=%s',
444
  'default_params' => 'nologo=1',
445
  'auto_thumbnail' => true,
446
- 'tests' => array(
447
  array(
448
  'url' => 'https://alugha.com/1/videos/youtube-54m1YfEuYU8',
449
- 'id' => 'youtube-54m1YfEuYU8',
450
  ),
451
  array(
452
  'url' => 'https://alugha.com/videos/7cab9cd7-f64a-11e5-939b-c39074d29b86',
453
- 'id' => '7cab9cd7-f64a-11e5-939b-c39074d29b86',
454
  ),
455
  )
456
  ),
457
- 'archiveorg' => array(
458
  'name' => 'Archive.org',
459
  'regex' => $s . 'archive\.org/(details|embed)/(?<id>[0-9a-z\-]+)',
460
  'embed_url' => 'https://www.archive.org/embed/%s/',
461
  'default_params' => '',
462
  'auto_thumbnail' => false,
463
- 'tests' => array(
464
- array( 'url' => 'https://archive.org/details/arashyekt4_gmail_Cat', 'id' => 'arashyekt4' ),
 
 
 
465
  )
466
  ),
467
- 'break' => array(
468
  'regex' => 'https?://(www\.|view\.)break\.com/(video/|embed/)?[-a-z0-9]*?(?<id>[0-9]+)',
469
  'embed_url' => 'http://break.com/embed/%s',
470
  'default_params' => 'embed=1',
471
  'auto_thumbnail' => false,
472
- 'tests' => array(
473
  array(
474
  'url' => 'http://www.break.com/video/first-person-pov-of-tornado-strike-2542591-test',
475
- 'id' => 2542591,
476
  ),
477
  array(
478
  'url' => 'http://view.break.com/2542591-test',
479
- 'id' => 2542591,
480
  ),
481
  array(
482
  'url' => 'http://www.break.com/embed/2542591?embed=1',
483
- 'id' => 2542591,
484
  ),
485
  )
486
  ),
487
- 'brightcove' => array(
488
- 'regex' => 'https?://(players|link)\.brightcove\.net/(?<brightcove_account>[0-9]+)/(?<brightcove_player>[a-z0-9]+)_(?<brightcove_embed>[a-z0-9]+)/index\.html\?videoId=(?<id>[0-9]+)',
489
- 'embed_url' => 'https://players.brightcove.net/%s/%s_%s/index.html?videoId=%s',
490
- 'requires_src' => true,
491
- 'tests' => array(
492
  array(
493
- 'url' => 'http://players.brightcove.net/1160438696001/default_default/index.html?videoId=4587535845001',
494
- 'brightcove_account' => 1160438696001,
495
- 'brightcove_player' => 'default',
496
- 'brightcove_embed' => 'default',
497
- 'id' => 4587535845001,
498
  ),
499
  array(
500
- 'url' => 'http://players.brightcove.net/5107476400001/B1xUkhW8i_default/index.html?videoId=5371391223001',
501
- 'brightcove_account' => 5107476400001,
502
- 'brightcove_player' => 'B1xUkhW8i',
503
- 'brightcove_embed' => 'default',
504
- 'id' => 5371391223001,
505
  ),
506
  ),
507
  ),
508
- 'collegehumor' => array(
509
  'name' => 'CollegeHumor',
510
  'regex' => $s . 'collegehumor\.com/video/(?<id>[0-9]+)',
511
  'embed_url' => 'http://www.collegehumor.com/e/%s',
512
  'auto_thumbnail' => true,
513
  'auto_title' => true,
514
  'aspect_ratio' => '600:369',
515
- 'tests' => array(
516
  array(
517
  'url' => 'http://www.collegehumor.com/video/6854928/troopers-holopad',
518
  'id' => 6854928,
@@ -520,38 +517,38 @@ function arve_get_host_properties() {
520
  ),
521
  )
522
  ),
523
- 'comedycentral' => array(
524
  'name' => 'Comedy Central',
525
  'regex' => 'https?://media\.mtvnservices\.com/embed/mgid:arc:video:comedycentral\.com:(?<id>[-a-z0-9]{36})',
526
  'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:%s',
527
  'requires_src' => true,
528
  'auto_thumbnail' => false,
529
- 'tests' => array(
530
  array(
531
  'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c80adf02-3e24-437a-8087-d6b77060571c',
532
- 'id' => 'c80adf02-3e24-437a-8087-d6b77060571c',
533
  ),
534
  array(
535
  'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
536
- 'id' => 'c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
537
  ),
538
  )
539
  ),
540
- 'dailymotion' => array(
541
  'regex' => $s . '(dai\.ly|dailymotion\.com/video)/(?<id>[a-z0-9]+)',
542
  'embed_url' => 'https://www.dailymotion.com/embed/video/%s',
543
  'default_params' => 'logo=0&hideInfos=1&related=0',
544
  'auto_thumbnail' => true,
545
  'auto_title' => true,
546
- 'tests' => array(
547
  array(
548
  'url' => 'http://www.dailymotion.com/video/x41ia79_mass-effect-andromeda-gameplay-alpha_videogames',
549
- 'id' => 'x41ia79',
550
  'oembed_title' => 'Mass Effect Andromeda - Gameplay Alpha',
551
  ),
552
  array(
553
  'url' => 'http://dai.ly/x3cwlqz',
554
- 'id' => 'x3cwlqz',
555
  'oembed_title' => 'Mass Effect Andromeda',
556
  ),
557
  ),
@@ -561,465 +558,502 @@ function arve_get_host_properties() {
561
  'type' => 'bool',
562
  ),
563
  ),
564
- 'query_argss' => array(
565
- 'api' => array( 0, 1 ),
566
- 'autoplay' => array( 0, 1 ),
567
- 'chromeless' => array( 0, 1 ),
568
- 'highlight' => array( 0, 1 ),
569
- 'html' => array( 0, 1 ),
570
- 'id' => 'int',
571
- 'info' => array( 0, 1 ),
572
- 'logo' => array( 0, 1 ),
573
- 'network' => array( 'dsl', 'cellular' ),
574
- 'origin' => array( 0, 1 ),
575
- 'quality' => array( 240, 380, 480, 720, 1080, 1440, 2160 ),
576
- 'related' => array( 0, 1 ),
577
- 'start' => 'int',
578
- 'startscreen' => array( 0, 1 ),
579
- 'syndication' => 'int',
580
- 'webkit-playsinline' => array( 0, 1 ),
581
- 'wmode' => array( 'direct', 'opaque' ),
582
  ),
583
  ),
584
- 'dailymotionlist' => array(
585
  # http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45
586
  # http://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2Fx3yk8p_PHIL-MDS_nature-et-environnement-2011%2F1&&autoplay=0&mute=0
587
 
588
- 'regex' => $s . 'dailymotion\.com/playlist/(?<id>[a-z0-9]+)',
589
- 'embed_url' => 'https://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2F%s%2F1&',
590
- 'auto_thumbnail' => false,
591
- 'tests' => array(
592
  array(
593
  'url' => 'http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45',
594
- 'id' => 'x3yk8p',
595
  )
596
  )
597
  ),
598
- 'facebook' => array(
599
  # https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater
600
  #<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FTheKillingsOfTonyBlair%2Fvideos%2Fvb.551089058285349%2F562955837098671%2F%3Ftype%3D2%26theater&width=500&show_text=false&height=280&appId" width="500" height="280" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
601
- 'regex' => '(?<id>https?://([a-z]+\.)?facebook\.com/[-.a-z0-9]+/videos/[a-z.0-9/]+)',
602
- 'url_encode_id' => true,
603
- 'embed_url' => 'https://www.facebook.com/plugins/video.php?href=%s',
604
- #'embed_url' => 'https://www.facebook.com/video/embed?video_id=%s',
605
- 'auto_thumbnail' => true,
606
- 'tests' => array(
607
  array(
608
- 'url' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater',
609
- 'id' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/',
610
  ),
611
  array(
612
- 'url' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
613
- 'id' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
614
  ),
615
  ),
616
  ),
617
- 'funnyordie' => array(
618
  'name' => 'Funny or Die',
619
  'regex' => $s . 'funnyordie\.com/videos/(?<id>[a-z0-9_]+)',
620
  'embed_url' => 'https://www.funnyordie.com/embed/%s',
621
  'auto_thumbnail' => true,
622
  'auto_title' => true,
623
  'aspect_ratio' => '640:400',
624
- 'tests' => array(
625
  array(
626
  'url' => 'http://www.funnyordie.com/videos/76585438d8/sarah-silverman-s-we-are-miracles-hbo-special',
627
- 'id' => '76585438d8',
628
  'oembed_title' => "Sarah Silverman's - We Are Miracles HBO Special",
629
  ),
630
  )
631
  ),
632
- 'ign' => array(
633
  'name' => 'IGN',
634
  'regex' => '(?<id>' . $s . 'ign\.com/videos/[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9a-z\-]+)',
635
  'embed_url' => 'http://widgets.ign.com/video/embed/content.html?url=%s',
636
  'auto_thumbnail' => false,
637
- 'tests' => array(
638
  array(
639
- 'url' => 'http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
640
- 'id' => 'http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
641
- ),
642
- )
643
- ),
644
- #https://cdnapisec.kaltura.com/p/243342/sp/24334200/embedIframeJs/uiconf_id/20540612/partner_id/243342?iframeembed=true&playerId=kaltura_player&entry_id=1_sf5ovm7u&flashvars[streamerType]=auto" width="560" height="395" allowfullscreen webkitallowfullscreen mozAllowFullScreen frameborder="0"></iframe>
645
- 'kickstarter' => array(
646
- 'regex' => $s . 'kickstarter\.com/projects/(?<id>[0-9a-z\-]+/[-0-9a-z\-]+)',
647
- 'embed_url' => 'https://www.kickstarter.com/projects/%s/widget/video.html',
648
- 'auto_thumbnail' => false,
649
- 'tests' => array(
650
- array(
651
- 'url' => 'https://www.kickstarter.com/projects/obsidian/project-eternity?ref=discovery',
652
- 'id' => 'obsidian/project-eternity'
653
- ),
654
- array(
655
- 'url' => 'https://www.kickstarter.com/projects/trinandtonic/friendship-postcards?ref=category_featured',
656
- 'id' => 'trinandtonic/friendship-postcards'
657
  ),
658
  )
659
  ),
660
- 'liveleak' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  'name' => 'LiveLeak',
662
  'regex' => $s . 'liveleak\.com/(view|ll_embed)\?(?<id>(f|i)=[0-9a-z\_]+)',
663
  'embed_url' => 'https://www.liveleak.com/ll_embed?%s',
664
  'default_params' => '',
665
  'auto_thumbnail' => true,
666
- 'tests' => array(
667
- array( 'url' => 'http://www.liveleak.com/view?i=703_1385224413', 'id' => 'i=703_1385224413' ), # Page/item 'i=' URL
668
- array( 'url' => 'http://www.liveleak.com/view?f=c85bdf5e45b2', 'id' => 'f=c85bdf5e45b2' ), #File f= URL
 
 
 
 
 
 
669
  ),
670
- 'test_ids' => array(
671
  'f=c85bdf5e45b2',
672
  'c85bdf5e45b2'
673
  ),
674
  ),
675
- 'livestream' => array(
676
  'regex' => $s . 'livestream\.com/accounts/(?<id>[0-9]+/events/[0-9]+(/videos/[0-9]+)?)',
677
  'embed_url' => 'https://livestream.com/accounts/%s/player',
678
  'default_params' => 'width=1280&height=720&enableInfoAndActivity=true&defaultDrawer=&mute=false',
679
  'auto_thumbnail' => false,
680
- 'tests' => array(
681
  # https://livestream.com/accounts/23470201/events/7021166
682
  # <iframe id="ls_embed_1491401341" src="https://livestream.com/accounts/4683311/events/3747538/player?width=640&height=360&enableInfoAndActivity=true&defaultDrawer=&autoPlay=true&mute=false" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen> </iframe>
683
  # https://livestream.com/DemocracyNow/dirtywars/videos/17500857
684
  # <iframe id="ls_embed_1491412166" src="https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen> </iframe>
685
- array( 'url' => 'https://livestream.com/accounts/23470201/events/7021166', 'id' => '23470201/events/7021166' ),
686
- array( 'url' => 'https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false', 'id' => '467901/events/2015991/videos/17500857' ),
 
 
 
 
 
 
687
  ),
688
  ),
689
- 'klatv' => array(
690
  'regex' => $s . 'kla(gemauer)?.tv/(?<id>[0-9]+)',
691
  'embed_url' => 'https://www.kla.tv/index.php?a=showembed&vidid=%s',
692
  'name' => 'kla.tv',
693
  'url' => true,
694
  'auto_thumbnail' => false,
695
- 'tests' => array(
696
- array( 'url' => 'http://www.klagemauer.tv/9106', 'id' => 9106 ),
697
- array( 'url' => 'http://www.kla.tv/9122', 'id' => 9122 ),
 
 
 
 
 
 
698
  ),
699
  ),
700
- 'metacafe' => array(
701
  'regex' => $s . 'metacafe\.com/(watch|fplayer)/(?<id>[0-9]+)',
702
  'embed_url' => 'http://www.metacafe.com/embed/%s/',
703
  'auto_thumbnail' => false,
704
- 'tests' => array(
705
- array( 'url' => 'http://www.metacafe.com/watch/11433151/magical-handheld-fireballs/', 'id' => 11433151 ),
706
- array( 'url' => 'http://www.metacafe.com/watch/11322264/everything_wrong_with_robocop_in_7_minutes/', 'id' => 11322264 ),
 
 
 
 
 
 
707
  ),
708
  ),
709
- 'movieweb' => array(
710
  'regex' => $s . 'movieweb\.com/v/(?<id>[a-z0-9]{14})',
711
  'embed_url' => 'http://movieweb.com/v/%s/embed',
712
  'auto_thumbnail' => false,
713
  'requires_src' => true,
714
- 'tests' => array(
715
- array( 'url' => 'http://movieweb.com/v/VIOF6ytkiMEMSR/embed', 'id' => 'VIOF6ytkiMEMSR' ),
 
 
 
716
  ),
717
  ),
718
- 'myspace' => array(
719
  #<iframe width="480" height="270" src="//media.myspace.com/play/video/house-of-lies-season-5-premiere-109903807-112606834" frameborder="0" allowtransparency="true" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><p><a href="https://media.myspace.com/showtime/video/house-of-lies-season-5-premiere/109903807">House of Lies Season 5 Premiere</a> from <a href="https://media.myspace.com/Showtime">Showtime</a> on <a href="https://media.myspace.com">Myspace</a>.</p>
720
  'regex' => $s . 'myspace\.com/.+/(?<id>[0-9]+)',
721
  'embed_url' => 'https://media.myspace.com/play/video/%s',
722
  'auto_thumbnail' => false,
723
- 'tests' => array(
724
- array( 'url' => 'https://myspace.com/myspace/video/dark-rooms-the-shadow-that-looms-o-er-my-heart-live-/109471212', 'id' => 109471212 ),
 
 
 
725
  )
726
  ),
727
- 'snotr' => array(
728
  'regex' => $s . 'snotr\.com/(video|embed)/(?<id>[0-9]+)',
729
  'embed_url' => 'http://www.snotr.com/embed/%s',
730
  'auto_thumbnail' => false,
731
- 'tests' => array(
732
  array(
733
  'url' => 'http://www.snotr.com/video/12314/How_big_a_truck_blind_spot_really_is',
734
- 'id' => 12314,
735
  ),
736
  )
737
  ),
738
- 'spike' => array(
739
  'regex' => 'https?://media.mtvnservices.com/embed/mgid:arc:video:spike\.com:(?<id>[a-z0-9\-]{36})',
740
  'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:%s',
741
  'requires_src' => true,
742
  'auto_thumbnail' => false,
743
- 'tests' => array(
744
  array(
745
  'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:6a219882-c412-46ce-a8c9-32e043396621',
746
- 'id' => '6a219882-c412-46ce-a8c9-32e043396621',
747
  ),
748
  ),
749
  ),
750
- 'ted' => array(
751
  'name' => 'TED Talks',
752
  'regex' => $s . 'ted\.com/talks/(?<id>[a-z0-9_]+)',
753
  'embed_url' => 'https://embed-ssl.ted.com/talks/%s.html',
754
  'auto_thumbnail' => true,
755
  'auto_title' => true,
756
- 'tests' => array(
757
  array(
758
  'url' => 'https://www.ted.com/talks/margaret_stewart_how_youtube_thinks_about_copyright',
759
- 'id' => 'margaret_stewart_how_youtube_thinks_about_copyright'
760
  ),
761
  ),
762
  ),
763
- 'twitch' => array(
764
  'regex' => $s . 'twitch.tv/(?!directory)(?|[a-z0-9_]+/v/(?<id>[0-9]+)|(?<id>[a-z0-9_]+))',
765
  'embed_url' => 'https://player.twitch.tv/?channel=%s', # if numeric id https://player.twitch.tv/?video=v%s
766
  'auto_thumbnail' => true,
767
- 'tests' => array(
768
  array(
769
  'url' => 'https://www.twitch.tv/whiskeyexperts',
770
  'id' => 'whiskeyexperts',
771
  'api_img_contains' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/whiskyexperts',
772
  ),
773
  array(
774
- 'url' => 'https://www.twitch.tv/imaqtpie',
775
- 'id' => 'imaqtpie',
776
  'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
777
  ),
778
  array(
779
- 'url' => 'https://www.twitch.tv/imaqtpie/v/95318019',
780
- 'id' => 95318019,
781
  'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
782
  ),
783
  ),
784
  ),
785
- 'ustream' => array(
786
  'regex' => $s . 'ustream\.tv/(embed/)?(channel/)?(?<id>[0-9]+|recorded/[0-9]+(/highlight/[0-9]+)?)',
787
  'embed_url' => 'http://www.ustream.tv/embed/%s',
788
  'default_params' => 'html5ui',
789
  'auto_thumbnail' => false,
790
  'aspect_ratio' => '480:270',
791
- 'tests' => array(
792
  array(
793
  'url' => 'http://www.ustream.tv/recorded/59999872?utm_campaign=ustre.am&utm_source=ustre.am/:43KHS&utm_medium=social&utm_content=20170405204127',
794
- 'id' => 'recorded/59999872'
795
  ),
796
  array(
797
  'url' => 'http://www.ustream.tv/embed/17074538?wmode=transparent&v=3&autoplay=false',
798
- 'id' => '17074538'
799
  ),
800
  ),
801
  ),
802
- 'rutube' => array(
803
- 'name' => 'RuTube.ru',
804
- 'regex' => $s . 'rutube\.ru/play/embed/(?<id>[0-9]+)',
805
- 'embed_url' => 'https://rutube.ru/play/embed/%s',
806
- 'tests' => array(
807
  array(
808
  'url' => 'https://rutube.ru/play/embed/9822149',
809
- 'id' => '9822149'
810
  ),
811
  ),
812
  ),
813
- 'veoh' => array(
814
  'regex' => $s . 'veoh\.com/watch/(?<id>[a-z0-9]+)',
815
  'embed_url' => 'http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1396&permalinkId=%s',
816
  'default_params' => 'player=videodetailsembedded&id=anonymous',
817
  'auto_thumbnail' => false,
818
- #'aspect_ratio' => 60.257,
819
- 'tests' => array(
820
  array(
821
  'url' => 'http://www.veoh.com/watch/v19866882CAdjNF9b',
822
- 'id' => 'v19866882CAdjNF9b'
823
  ),
824
  )
825
  ),
826
- 'vevo' => array(
827
  'regex' => $s . 'vevo\.com/watch/([^\/]+/[^\/]+/)?(?<id>[a-z0-9]+)',
828
  'embed_url' => 'https://scache.vevo.com/assets/html/embed.html?video=%s',
829
  'default_params' => 'playlist=false&playerType=embedded&env=0',
830
  'auto_thumbnail' => false,
831
- 'tests' => array(
832
  array(
833
- 'url' => 'https://www.vevo.com/watch/the-offspring/the-kids-arent-alright/USSM20100649',
834
- 'id' => 'USSM20100649'
835
  ),
836
- #array( '', '' ),
837
- #array( '', '' ),
838
  ),
839
  ),
840
- 'viddler' => array(
841
  'regex' => $s . 'viddler\.com/(embed|v)/(?<id>[a-z0-9]{8})',
842
- #'embed_url' => 'https://www.viddler.com/player/%s/',
843
- #'default_params' => 'wmode=transparent&player=full&f=1&disablebranding=1',
844
  'embed_url' => 'https://www.viddler.com/embed/%s/',
845
  'default_params' => '?f=1&player=full&secret=59822701&disablebackwardseek=false&disableseek=false&disableforwardseek=false&make_responsive=false&loop=false&nologo=false&hd=false',
846
  'auto_thumbnail' => false,
847
  'auto_title' => false,
848
  'aspect_ratio' => '545:349',
849
- 'tests' => array(
850
  array(
851
  'url' => 'https://www.viddler.com/v/a695c468',
852
- 'id' => 'a695c468'
853
  ),
854
  ),
855
  ),
856
- 'vidspot' => array(
857
  'name' => 'vidspot.net',
858
  'regex' => $s . 'vidspot\.net/(embed-)?(?<id>[a-z0-9]+)',
859
  'embed_url' => 'http://vidspot.net/embed-%s.html',
860
- 'tests' => array(
861
- array( 'url' => 'http://vidspot.net/285wf9uk3rry', 'id' => '285wf9uk3rry' ),
862
- array( 'url' => 'http://vidspot.net/embed-285wf9uk3rry.html', 'id' => '285wf9uk3rry' ),
 
 
 
 
 
 
863
  ),
864
  ),
865
- 'vine' => array(
866
  'regex' => $s . 'vine\.co/v/(?<id>[a-z0-9]+)',
867
  'embed_url' => 'https://vine.co/v/%s/embed/simple',
868
  'default_params' => '', //* audio=1 supported
869
  'auto_thumbnail' => false,
870
  'aspect_ratio' => '1:1',
871
- 'tests' => array(
872
- array( 'url' => 'https://vine.co/v/bjAaLxQvOnQ', 'id' => 'bjAaLxQvOnQ' ),
873
- array( 'url' => 'https://vine.co/v/MbrreglaFrA', 'id' => 'MbrreglaFrA' ),
874
- array( 'url' => 'https://vine.co/v/bjHh0zHdgZT/embed', 'id' => 'bjHh0zHdgZT' ),
 
 
 
 
 
 
 
 
 
875
  ),
876
  ),
877
- 'vimeo' => array(
878
  'regex' => 'https?://(player\.)?vimeo\.com/((video/)|(channels/[a-z]+/)|(groups/[a-z]+/videos/))?(?<id>[0-9]+)(?<vimeo_secret>/[0-9a-z]+)?',
879
  'embed_url' => 'https://player.vimeo.com/video/%s',
880
  'default_params' => 'html5=1&title=1&byline=0&portrait=0',
881
  'auto_thumbnail' => true,
882
  'auto_title' => true,
883
- 'tests' => array(
884
- array( 'url' => 'https://vimeo.com/124400795', 'id' => 124400795 ),
885
- array( 'url' => 'https://player.vimeo.com/124400795', 'id' => 124400795 ),
886
- ),
887
- /*
888
- 'query_argss' => array(
889
- 'autoplay' => array( 'bool', __( 'Autoplay', ARVE_SLUG ) ),
890
- 'badge' => array( 'bool', __( 'Badge', ARVE_SLUG ) ),
891
- 'byline' => array( 'bool', __( 'Byline', ARVE_SLUG ) ),
892
- 'color' => 'string',
893
- 'loop' => array( 0, 1 ),
894
- 'player_id' => 'int',
895
- 'portrait' => array( 0, 1 ),
896
- 'title' => array( 0, 1 ),
897
  ),
898
- */
899
  ),
900
- 'vk' => array(
901
- 'name' => 'VK',
902
- #https://vk.com/video 162756656_171388096
903
- #https://vk.com/video_ext.php?oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1
904
  'regex' => $s . 'vk\.com/video_ext\.php\?(?<id>[^ ]+)',
905
  'embed_url' => 'https://vk.com/video_ext.php?%s',
906
  'requires_src' => true,
907
  'auto_thumbnail' => false,
908
- 'tests' => array(
909
  array(
910
  'url' => 'https://vk.com/video_ext.php?oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1',
911
- 'id' => 'oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1'
912
  ),
913
  ),
914
  ),
915
- 'vzaar' => array(
916
  'regex' => $s . 'vzaar.(com|tv)/(videos/)?(?<id>[0-9]+)',
917
  'embed_url' => 'https://view.vzaar.com/%s/player',
918
- 'tests' => array(
919
- array( 'url' => 'https://vzaar.com/videos/993324', 'id' => 993324 ),
920
- array( 'url' => 'https://vzaar.com/videos/1515906', 'id' => 1515906 ),
 
 
 
 
 
 
921
  ),
922
  ),
923
- 'wistia' => array(
924
- # fast.wistia.net/embed/iframe/g5pnf59ala?videoFoam=true
925
  'regex' => 'https?://fast\.wistia\.net/embed/iframe/(?<id>[a-z0-9]+)',
926
  'embed_url' => 'https://fast.wistia.net/embed/iframe/%s',
927
  'default_params' => 'videoFoam=true',
928
- 'tests' => array(
929
  array(
930
  'url' => 'https://fast.wistia.net/embed/iframe/g5pnf59ala?videoFoam=true',
931
- 'id' => 'g5pnf59ala'
932
  ),
933
  ),
934
  ),
935
- 'xtube' => array(
936
  'name' => 'XTube',
937
  'regex' => $s . 'xtube\.com/watch\.php\?v=(?<id>[a-z0-9_\-]+)',
938
  'embed_url' => 'http://www.xtube.com/embedded/user/play.php?v=%s',
939
  'auto_thumbnail' => false,
940
- 'tests' => array(
941
- array( 'url' => 'http://www.xtube.com/watch.php?v=1234', 'id' => 1234 ),
 
 
 
942
  ),
943
  ),
944
- 'yahoo' => array(
945
  'regex' => '(?<id>https?://([a-z.]+)yahoo\.com/[/-a-z0-9öäü]+\.html)',
946
  'embed_url' => '%s',
947
  'default_params' => 'format=embed',
948
  'auto_thumbnail' => true,
949
  'auto_title' => true,
950
- 'tests' => array(
951
  array(
952
  'url' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html?format=embed&player_autoplay=false',
953
  'id' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html'
954
  ),
955
  array(
956
  'url' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html?format=embed',
957
- 'id' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html'
958
  ),
959
  )
960
  ),
961
- 'youku' => array(
962
  'regex' => 'https?://([a-z.]+)?\.youku.com/(embed/|v_show/id_)(?<id>[a-z0-9]+)',
963
  'embed_url' => 'https://player.youku.com/embed/%s',
964
  'auto_thumbnail' => false,
965
- # <iframe height=498 width=510 src="http://player.youku.com/embed/XMTUyODYwOTc4OA==" frameborder=0 allowfullscreen></iframe>
966
- 'tests' => array(
967
  array(
968
  'url' => 'http://v.youku.com/v_show/id_XMTczMDAxMjIyNA==.html?f=27806190',
969
- 'id' => 'XMTczMDAxMjIyNA',
970
  ),
971
  array(
972
  'url' => 'http://player.youku.com/embed/XMTUyODYwOTc4OA==',
973
- 'id' => 'XMTUyODYwOTc4OA',
974
  ),
975
  ),
976
  ),
977
- 'youtube' => array(
978
  'name' => 'YouTube',
979
  'regex' => $s . '(youtube\.com\/\S*((\/e(mbed))?\/|watch\?(\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11}((\?|&)list=[a-z0-9_\-]+)?)',
980
  'embed_url' => 'https://www.youtube.com/embed/%s',
981
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
982
  'auto_thumbnail' => true,
983
  'auto_title' => true,
984
- #'[youtube id="XQEiv7t1xuQ"]',
985
- 'tests' => array(
986
  array(
987
- 'url' => 'https://youtu.be/dqLyB5srdGI',
988
- 'id' => 'dqLyB5srdGI',
989
  ),
990
  array(
991
  'url' => 'https://www.youtube.com/watch?v=-fEo3kgHFaw',
992
- 'id' => '-fEo3kgHFaw',
993
  ),
994
  array(
995
  'url' => 'http://www.youtube.com/watch?v=vrXgLhkv21Y',
996
- 'id' => 'vrXgLhkv21Y',
997
  'oembed_title' => 'TerrorStorm Full length version',
998
  ),
999
  array(
1000
  'url' => 'https://youtu.be/hRonZ4wP8Ys',
1001
- 'id' => 'hRonZ4wP8Ys',
1002
  'oembed_title' => 'One Bright Dot',
1003
  ),
1004
  array(
1005
  'url' => 'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10', # The index part will be ignored
1006
- 'id' => 'GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA'
1007
  ),
1008
  array(
1009
  'url' => 'https://youtu.be/b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg',
1010
- 'id' => 'b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg'
1011
  ),
1012
  ),
1013
  'specific_tests' => array(
1014
- __('URL from youtu.be shortener', ARVE_SLUG),
1015
  'http://youtu.be/3Y8B93r2gKg',
1016
- __('Youtube playlist URL inlusive the video to start at. The index part will be ignored and is not needed', ARVE_SLUG) ,
1017
  'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10',
1018
- __('Loop a YouTube video', ARVE_SLUG),
1019
  '[youtube id="FKkejo2dMV4" parameters="playlist=FKkejo2dMV4&loop=1"]',
1020
- __('Enable annotations and related video at the end (disable by default with this plugin)', ARVE_SLUG),
1021
  '[youtube id="uCQXKYPiz6M" parameters="iv_load_policy=1"]',
1022
- __('Testing Youtube Starttimes', ARVE_SLUG),
1023
  'http://youtu.be/vrXgLhkv21Y?t=1h19m14s',
1024
  'http://youtu.be/vrXgLhkv21Y?t=19m14s',
1025
  'http://youtu.be/vrXgLhkv21Y?t=1h',
@@ -1028,189 +1062,50 @@ function arve_get_host_properties() {
1028
  __( 'The Parameter start only takes values in seconds, this will start the video at 1 minute and 1 second', ARVE_SLUG ),
1029
  '[youtube id="uCQXKYPiz6M" parameters="start=61"]',
1030
  ),
1031
- /*
1032
- 'query_args' => array(
1033
- array(
1034
- 'attr' => 'autohide',
1035
- 'type' => 'bool',
1036
- 'name' => __( 'Autohide', ARVE_SLUG )
1037
- ),
1038
- array(
1039
- 'attr' => 'autoplay',
1040
- 'type' => 'bool',
1041
- 'name' => __( 'Autoplay', ARVE_SLUG )
1042
- ),
1043
- array(
1044
- 'attr' => 'cc_load_policy',
1045
- 'type' => 'bool',
1046
- 'name' => __( 'cc_load_policy', ARVE_SLUG )
1047
- ),
1048
- array(
1049
- 'attr' => 'color',
1050
- 'type' => array(
1051
- '' => __( 'Default', ARVE_SLUG ),
1052
- 'red' => __( 'Red', ARVE_SLUG ),
1053
- 'white' => __( 'White', ARVE_SLUG ),
1054
- ),
1055
- 'name' => __( 'Color', ARVE_SLUG )
1056
- ),
1057
- array(
1058
- 'attr' => 'controls',
1059
- 'type' => array(
1060
- '' => __( 'Default', ARVE_SLUG ),
1061
- 0 => __( 'None', ARVE_SLUG ),
1062
- 1 => __( 'Yes', ARVE_SLUG ),
1063
- 2 => __( 'Yes load after click', ARVE_SLUG ),
1064
- ),
1065
- 'name' => __( 'Controls', ARVE_SLUG )
1066
- ),
1067
- array(
1068
- 'attr' => 'disablekb',
1069
- 'type' => 'bool',
1070
- 'name' => __( 'disablekb', ARVE_SLUG )
1071
- ),
1072
- array(
1073
- 'attr' => 'enablejsapi',
1074
- 'type' => 'bool',
1075
- 'name' => __( 'JavaScript API', ARVE_SLUG )
1076
- ),
1077
- array(
1078
- 'attr' => 'end',
1079
- 'type' => 'number',
1080
- 'name' => __( 'End', ARVE_SLUG )
1081
- ),
1082
- array(
1083
- 'attr' => 'fs',
1084
- 'type' => 'bool',
1085
- 'name' => __( 'Fullscreen', ARVE_SLUG )
1086
- ),
1087
- array(
1088
- 'attr' => 'hl',
1089
- 'type' => 'text',
1090
- 'name' => __( 'Language???', ARVE_SLUG )
1091
- ),
1092
- array(
1093
- 'attr' => 'iv_load_policy',
1094
- 'type' => array(
1095
- '' => __( 'Default', ARVE_SLUG ),
1096
- 1 => __( 'Show annotations', ARVE_SLUG ),
1097
- 3 => __( 'Do not show annotations', ARVE_SLUG ),
1098
- ),
1099
- 'name' => __( 'iv_load_policy', ARVE_SLUG ),
1100
- ),
1101
- array(
1102
- 'attr' => 'list',
1103
- 'type' => 'medium-text',
1104
- 'name' => __( 'Language???', ARVE_SLUG )
1105
- ),
1106
- array(
1107
- 'attr' => 'listType',
1108
- 'type' => array(
1109
- '' => __( 'Default', ARVE_SLUG ),
1110
- 'playlist' => __( 'Playlist', ARVE_SLUG ),
1111
- 'search' => __( 'Search', ARVE_SLUG ),
1112
- 'user_uploads' => __( 'User Uploads', ARVE_SLUG ),
1113
- ),
1114
- 'name' => __( 'List Type', ARVE_SLUG ),
1115
- ),
1116
- array(
1117
- 'attr' => 'loop',
1118
- 'type' => 'bool',
1119
- 'name' => __( 'Loop', ARVE_SLUG ),
1120
- ),
1121
- array(
1122
- 'attr' => 'modestbranding',
1123
- 'type' => 'bool',
1124
- 'name' => __( 'Modestbranding', ARVE_SLUG ),
1125
- ),
1126
- array(
1127
- 'attr' => 'origin',
1128
- 'type' => 'bool',
1129
- 'name' => __( 'Origin', ARVE_SLUG ),
1130
- ),
1131
- array(
1132
- 'attr' => 'playerapiid',
1133
- 'type' => 'bool',
1134
- 'name' => __( 'playerapiid', ARVE_SLUG ),
1135
- ),
1136
- array(
1137
- 'attr' => 'playlist',
1138
- 'type' => 'bool',
1139
- 'name' => __( 'Playlist', ARVE_SLUG ),
1140
- ),
1141
- array(
1142
- 'attr' => 'playsinline',
1143
- 'type' => 'bool',
1144
- 'name' => __( 'playsinline', ARVE_SLUG ),
1145
- ),
1146
- array(
1147
- 'attr' => 'rel',
1148
- 'type' => 'bool',
1149
- 'name' => __( 'Related Videos at End', ARVE_SLUG ),
1150
- ),
1151
- array(
1152
- 'attr' => 'showinfo',
1153
- 'type' => 'bool',
1154
- 'name' => __( 'Show Info', ARVE_SLUG ),
1155
- ),
1156
- array(
1157
- 'attr' => 'start',
1158
- 'type' => 'number',
1159
- 'name' => __( 'Start', ARVE_SLUG ),
1160
- ),
1161
- array(
1162
- 'attr' => 'theme',
1163
- 'type' => array(
1164
- '' => __( 'Default', ARVE_SLUG ),
1165
- 'dark' => __( 'Dark', ARVE_SLUG ),
1166
- 'light' => __( 'Light', ARVE_SLUG ),
1167
- ),
1168
- 'name' => __( 'Theme', ARVE_SLUG ),
1169
- ),
1170
- ),
1171
- */
1172
  ),
1173
- 'youtubelist' => array(
1174
  'regex' => $s . 'youtube\.com/(embed/videoseries|playlist)\?list=(?<id>[-a-z0-9_]+)',
1175
  'name' => 'YouTube Playlist',
1176
  'embed_url' => 'https://www.youtube.com/embed/videoseries?list=%s',
1177
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1178
  'auto_thumbnail' => true,
1179
- 'tests' => array(
1180
  array(
1181
  'url' => 'https://www.youtube.com/playlist?list=PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7',
1182
- 'id' => 'PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7'
1183
  ),
1184
  array(
1185
  'url' => 'https://www.youtube.com/embed/videoseries?list=PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
1186
- 'id' => 'PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
1187
  )
1188
  )
1189
  ),
1190
- 'html5' => array(
1191
  'name' => 'HTML5 video files directly',
1192
- #'regex' => '(?<id>' . $s . 'dropbox.com/[^.]+\.(mp4|webm|ogv)$)', # URLs ending with .mp4, .webm ... are handled by word
1193
  'aspect_ratio' => false,
1194
  ),
1195
- 'iframe' => array(
1196
  'embed_url' => '%s',
1197
  'default_params' => '',
1198
  'auto_thumbnail' => false,
1199
- 'tests' => array(
1200
- array( 'url' => 'https://example.com/', 'id' => 'https://example.com/' ),
 
 
 
1201
  ),
1202
  ),
1203
- 'google_drive' => array( 'name', 'Google Drive' ),
1204
- 'dropbox' => null,
1205
- 'ooyala' => null,
1206
  );
1207
 
1208
  foreach ( $properties as $key => $value ) {
1209
 
1210
- if( empty( $value['name'] ) ) {
1211
  $properties[ $key ]['name'] = ucfirst( $key );
1212
  }
1213
- if( ! isset( $value['aspect_ratio'] ) ) {
1214
  $properties[ $key ]['aspect_ratio'] = '16:9';
1215
  }
1216
  }
@@ -1232,7 +1127,7 @@ function arve_attr( $attr = array() ) {
1232
  continue;
1233
  } elseif ( '' === $value || true === $value ) {
1234
  $html .= sprintf( ' %s', esc_html( $key ) );
1235
- } elseif ( in_array( $key, array( 'href', 'data-href', 'src', 'data-src' ) ) ) {
1236
  $html .= sprintf( ' %s="%s"', esc_html( $key ), arve_esc_url( $value ) );
1237
  } else {
1238
  $html .= sprintf( ' %s="%s"', esc_html( $key ), esc_attr( $value ) );
@@ -1248,28 +1143,28 @@ function arve_esc_url( $url ) {
1248
 
1249
  function arve_starts_with( $haystack, $needle ) {
1250
  // search backwards starting from haystack length characters from the end
1251
- return $needle === "" || strrpos( $haystack, $needle, -strlen( $haystack ) ) !== false;
1252
  }
1253
 
1254
  function arve_ends_with( $haystack, $needle ) {
1255
  // search forward starting from end minus needle length characters
1256
- return $needle === "" || ( ( $temp = strlen($haystack) - strlen( $needle ) ) >= 0 && strpos( $haystack, $needle, $temp ) !== false );
1257
  }
1258
 
1259
  function arve_contains( $haystack, $needle ) {
1260
- return strpos( $haystack, $needle ) !== false;
1261
  }
1262
 
1263
  function arve_register_asset( $args ) {
1264
 
1265
  $defaults = array(
1266
- 'handle' => null,
1267
- 'src' => null,
1268
- 'deps' => array(),
1269
- 'in_footer' => true,
1270
- 'media' => null,
1271
- 'ver' => ARVE_VERSION,
1272
- 'automin' => false,
1273
  );
1274
 
1275
  $args = wp_parse_args( $args, $defaults );
44
  $supported_modes = arve_get_supported_modes();
45
 
46
  # legacy mode name
47
+ if ( 'thumbnail' === $options['mode'] ) {
48
 
49
  $options['mode'] = 'lazyload';
50
  update_option( 'arve_options_main', $options );
51
  }
52
 
53
+ if ( ! in_array( $options['mode'], array( 'normal', 'lazyload', 'lazyload-lightbox', 'link-lightbox' ), true ) ) {
54
 
55
  $options['mode'] = 'lazyload';
56
  update_option( 'arve_options_main', $options );
70
 
71
  foreach ( $properties as $provider => $values ) {
72
 
73
+ if ( ! empty( $values['auto_thumbnail'] ) ) {
74
  $auto_thumbs[] = $values['name'];
75
  }
76
+ if ( ! empty( $values['auto_title'] ) ) {
77
  $auto_title[] = $values['name'];
78
  }
79
+ if ( ! empty( $values['requires_src'] ) ) {
80
  $embed_code_only[] = $values['name'];
81
  }
82
  }
83
 
84
+ $auto_thumbs = implode( ', ', $auto_thumbs );
85
+ $auto_title = implode( ', ', $auto_title );
86
+ $embed_code_only = implode( ', ', $embed_code_only );
87
 
88
+ if ( in_array( $options['mode'], $supported_modes, true ) ) {
89
  $current_mode_name = $supported_modes[ $options['mode'] ];
90
  } else {
91
  $current_mode_name = $options['mode'];
94
  $definitions = array(
95
  array(
96
  'hide_from_settings' => true,
97
+ 'attr' => 'url',
98
+ 'label' => esc_html__( 'URL / Embed Code', ARVE_SLUG ),
99
+ 'type' => 'text',
100
+ 'meta' => array(
101
  'placeholder' => esc_attr__( 'Video URL / iframe Embed Code', ARVE_SLUG ),
102
  ),
103
+ 'description' => sprintf(
104
+ __( 'Post the URL of the video here. For %1$s and any <a href="%2$s">unlisted</a> video hosts paste their iframe embed codes or its src URL in here (providers embeds need to be responsive).', ARVE_SLUG ),
105
  $embed_code_only,
106
  'https://nextgenthemes.com/arve-pro/#video-host-support'
107
  )
115
  arve_get_supported_modes(),
116
  ),
117
  array(
118
+ 'attr' => 'align',
119
+ 'label' => esc_html__( 'Alignment', ARVE_SLUG ),
120
+ 'type' => 'select',
121
  'options' => array(
122
+ '' => sprintf( esc_html__( 'Default (current setting: %s)', ARVE_SLUG ), $options['align'] ),
123
  'none' => esc_html__( 'None', ARVE_SLUG ),
124
  'left' => esc_html__( 'Left', ARVE_SLUG ),
125
  'right' => esc_html__( 'Right', ARVE_SLUG ),
127
  ),
128
  ),
129
  array(
130
+ 'attr' => 'promote_link',
131
+ 'label' => esc_html__( 'ARVE Link', ARVE_SLUG ),
132
+ 'type' => 'select',
133
+ 'options' => array(
134
+ '' => sprintf(
135
  __( 'Default (current setting: %s)', ARVE_SLUG ),
136
  ( $options['promote_link'] ) ? esc_html__( 'Yes', ARVE_SLUG ) : esc_html__( 'No', ARVE_SLUG )
137
  ),
138
  'yes' => esc_html__( 'Yes', ARVE_SLUG ),
139
  'no' => esc_html__( 'No', ARVE_SLUG ),
140
  ),
141
+ 'description' => esc_html__( "Shows a small 'ARVE' link below the videos. Be the most awesome person and help promoting this plugin.", ARVE_SLUG ),
142
  ),
143
  array(
144
  'hide_from_settings' => true,
145
+ 'attr' => 'thumbnail',
146
+ 'label' => esc_html__( 'Thumbnail', ARVE_SLUG ),
147
+ 'type' => 'attachment',
148
+ 'libraryType' => array( 'image' ),
149
+ 'addButton' => esc_html__( 'Select Image', ARVE_SLUG ),
150
+ 'frameTitle' => esc_html__( 'Select Image', ARVE_SLUG ),
151
+ 'description' => sprintf( esc_html__( 'Preview image for Lazyload modes, always used for SEO. The Pro Addon is able to get them from %s automatically.', ARVE_SLUG ), $auto_thumbs ),
152
  ),
153
  array(
154
  'hide_from_settings' => true,
155
+ 'attr' => 'title',
156
+ 'label' => esc_html__( 'Title', ARVE_SLUG ),
157
+ 'type' => 'text',
158
+ 'description' => sprintf( esc_html__( 'Used for SEO, is visible on top of thumbnails in Lazyload modes, is used as link text in link-lightbox mode. The Pro Addon is able to get them from %s automatically.', ARVE_SLUG ), $auto_title ),
159
  ),
160
  array(
161
  'hide_from_settings' => true,
162
+ 'attr' => 'description',
163
+ 'label' => esc_html__( 'Description', ARVE_SLUG ),
164
+ 'type' => 'text',
165
+ 'meta' => array(
166
  'placeholder' => __( 'Description for SEO', ARVE_SLUG ),
167
  )
168
  ),
169
  array(
170
  'hide_from_settings' => true,
171
+ 'attr' => 'upload_date',
172
+ 'label' => esc_html__( 'Upload Date', ARVE_SLUG ),
173
+ 'type' => 'text',
174
+ 'meta' => array(
175
  'placeholder' => __( 'Upload Date for SEO, ISO 8601 format', ARVE_SLUG ),
176
  )
177
  ),
178
  array(
179
  'hide_from_settings' => true,
180
+ 'attr' => 'duration',
181
+ 'label' => esc_html__( 'Duration', ARVE_SLUG ),
182
+ 'type' => 'text',
183
+ 'description' => __( 'Duration in this format. <code>1HJ2M3S</code> for 1 hour, 2 minutes and 3 seconds. <code>5M</code> for 5 minutes.', ARVE_SLUG ),
184
  ),
185
  array(
186
+ 'attr' => 'autoplay',
187
+ 'label' => esc_html__( 'Autoplay', ARVE_SLUG ),
188
+ 'type' => 'select',
189
+ 'options' => array(
190
+ '' => sprintf(
191
  __( 'Default (current setting: %s)', ARVE_SLUG ),
192
  ( $options['autoplay'] ) ? esc_html__( 'Yes', ARVE_SLUG ) : esc_html__( 'No', ARVE_SLUG )
193
  ),
197
  'description' => esc_html__( 'Autoplay videos in normal mode, has no effect on lazyload modes.', ARVE_SLUG ),
198
  ),
199
  array(
200
+ 'hide_from_sc' => true,
201
+ 'attr' => 'video_maxwidth',
202
+ 'label' => esc_html__( 'Maximal Width', ARVE_SLUG ),
203
+ 'type' => 'number',
204
+ 'description' => __( 'Maximal size your videos can be displayed, if set to 0 it will default to your themes <code>$content_width</code>.', ARVE_SLUG ),
205
  ),
206
  array(
207
  'hide_from_settings' => true,
208
+ 'attr' => 'maxwidth',
209
+ 'label' => esc_html__( 'Maximal Width', ARVE_SLUG ),
210
+ 'type' => 'number',
211
+ 'meta' => array(
212
+ 'placeholder' => esc_attr__( 'in px - leave empty to use settings', ARVE_SLUG ),
213
  ),
214
  ),
215
  array(
216
+ 'hide_from_sc' => true,
217
+ 'attr' => 'align_maxwidth',
218
+ 'label' => esc_html__( 'Align Maximal Width', ARVE_SLUG ),
219
+ 'type' => 'number',
220
+ 'description' => esc_attr__( 'In px, Needed! Must be 100+ to work.', ARVE_SLUG ),
221
  ),
222
  array(
223
  'hide_from_settings' => true,
224
+ 'attr' => 'aspect_ratio',
225
+ 'label' => __( 'Aspect Ratio', ARVE_SLUG ),
226
+ 'type' => 'text',
227
+ 'meta' => array(
228
+ 'placeholder' => __( 'Custom aspect ratio like 4:3, 21:9 ... Leave empty for default.', ARVE_SLUG ),
229
  ),
230
  ),
231
  array(
232
  'hide_from_settings' => true,
233
+ 'attr' => 'parameters',
234
+ 'label' => esc_html__( 'Parameters', ARVE_SLUG ),
235
+ 'type' => 'text',
236
+ 'meta' => array(
237
  'placeholder' => __( 'provider specific parameters', ARVE_SLUG ),
238
  ),
239
+ 'description' => sprintf(
240
  __(
241
+ 'Note this values get merged with values set on the <a target="_blank" href="%1$s">ARVE setting page</a>. Example for YouTube <code>fs=0&start=30</code>. For reference: <a target="_blank" href="%2$s">Youtube Parameters</a>, <a target="_blank" href="%3$s">Dailymotion Parameters</a>, <a target="_blank" href="%4$s">Vimeo Parameters</a>.',
242
  ARVE_SLUG
243
  ),
244
  admin_url( 'admin.php?page=advanced-responsive-video-embedder' ),
250
  ),
251
  array(
252
  'hide_from_sc' => true,
253
+ 'attr' => 'wp_image_cache_time',
254
+ 'label' => esc_html__( 'Image Cache Time', ARVE_SLUG ),
255
+ 'type' => 'number',
256
+ 'description' => __( '(seconds) This plugin uses WordPress transients to cache video thumbnail URLS. This setting defines how long image URLs from the media Gallery are being stored before running WPs fuctions again to request them. For example: hour - 3600, day - 86400, week - 604800.', ARVE_SLUG ),
257
  ),
258
  array(
259
  'hide_from_sc' => true,
260
+ 'attr' => 'wp_video_override',
261
+ 'label' => esc_html__( 'Use ARVE for HTML5 video embeds', ARVE_SLUG ),
262
+ 'type' => 'select',
263
+ 'options' => array(
264
  'yes' => esc_html__( 'Yes', ARVE_SLUG ),
265
  'no' => esc_html__( 'No', ARVE_SLUG ),
266
  ),
267
+ 'description' => esc_html__( 'Use ARVE to embed HTML5 video files. ARVE uses the browsers players instead of loading the mediaelement player that WP uses.', ARVE_SLUG ),
268
  ),
269
  array(
270
+ 'attr' => 'controlslist',
271
+ 'label' => esc_html__( 'Chrome HTML5 Player controls', ARVE_SLUG ),
272
+ 'type' => 'text',
273
+ 'description' => __( 'controlsList attribute on &lt;video&gt; for example use <code>nodownload nofullscreen noremoteplayback</code> to hide the download and the fullscreen button on the chrome HTML5 video player and disable remote playback.', ARVE_SLUG ),
274
  ),
275
  array(
276
  'hide_from_settings' => true,
277
+ 'attr' => 'mp4',
278
+ 'label' => esc_html__( 'mp4 file', ARVE_SLUG ),
279
+ 'type' => 'url',
280
+ 'meta' => array(
 
 
 
 
281
  'placeholder' => __( '.mp4 file url for HTML5 video', ARVE_SLUG ),
282
  ),
283
  ),
284
  array(
285
  'hide_from_settings' => true,
286
+ 'attr' => 'webm',
287
+ 'label' => esc_html__( 'webm file', ARVE_SLUG ),
288
+ 'type' => 'url',
289
+ 'meta' => array(
 
 
 
 
290
  'placeholder' => __( '.webm file url for HTML5 video', ARVE_SLUG ),
291
  ),
292
  ),
293
  array(
294
  'hide_from_settings' => true,
295
+ 'attr' => 'ogv',
296
+ 'label' => esc_html__( 'ogv file', ARVE_SLUG ),
297
+ 'type' => 'url',
298
+ // phpcs:disable Squiz.PHP.CommentedOutCode.Found
299
  #'type' => 'attachment',
300
  #'libraryType' => array( 'video' ),
301
  #'addButton' => esc_html__( 'Select .ogv file', ARVE_SLUG ),
302
  #'frameTitle' => esc_html__( 'Select .ogv file', ARVE_SLUG ),
303
+ // phpcs:enable Squiz.PHP.CommentedOutCode.Found
304
+ 'meta' => array(
305
  'placeholder' => __( '.ogv file url for HTML5 video', ARVE_SLUG ),
306
  ),
307
  ),
308
  array(
309
  'hide_from_settings' => true,
310
+ 'attr' => 'controls',
311
+ 'label' => esc_html__( 'Show Controls?', ARVE_SLUG ),
312
+ 'type' => 'select',
313
+ 'options' => array(
314
+ '' => esc_html__( 'Yes', ARVE_SLUG ),
315
+ 'no' => esc_html__( 'No', ARVE_SLUG ),
316
  ),
317
+ 'description' => esc_html__( 'Show controls on HTML5 video.', ARVE_SLUG ),
318
  ),
319
  array(
320
  'hide_from_settings' => true,
321
+ 'attr' => 'loop',
322
+ 'label' => esc_html__( 'Loop?', ARVE_SLUG ),
323
+ 'type' => 'select',
324
+ 'options' => array(
325
  '' => esc_html__( 'No', ARVE_SLUG ),
326
  'yes' => esc_html__( 'Yes', ARVE_SLUG ),
327
  ),
328
+ 'description' => esc_html__( 'Loop HTML5 video.', ARVE_SLUG ),
329
  ),
330
  array(
331
  'hide_from_settings' => true,
333
  'label' => esc_html__( 'Mute?', ARVE_SLUG ),
334
  'type' => 'select',
335
  'options' => array(
336
+ '' => esc_html__( 'No', ARVE_SLUG ),
337
+ 'yes' => esc_html__( 'Yes', ARVE_SLUG ),
338
  ),
339
  'description' => esc_html__( 'Mute HTML5 video.', ARVE_SLUG ),
340
  ),
341
  array(
342
  'hide_from_sc' => true,
343
+ 'attr' => 'always_enqueue_assets',
344
+ 'label' => esc_html__( 'Assent loading', ARVE_SLUG ),
345
+ 'type' => 'select',
346
+ 'options' => array(
347
+ 'no' => esc_html__( 'When ARVE video is detected', ARVE_SLUG ),
348
+ 'yes' => esc_html__( 'Always', ARVE_SLUG ),
349
  ),
350
+ 'description' => sprintf(
351
  __( 'Usually ARVE will loads its scripts and styles only on pages what need them. In case your content is loaded via AJAX or the styles are not loaded for another reason you may have to enable this option', ARVE_SLUG ),
352
  'https://nextgenthemes.com/plugins/arve-pro/#support-table'
353
  ),
354
  ),
355
  array(
356
  'hide_from_sc' => true,
357
+ 'attr' => 'youtube_nocookie',
358
+ 'label' => esc_html__( 'Use youtube-nocookie.com url?', ARVE_SLUG ),
359
+ 'type' => 'select',
360
+ 'options' => array(
361
+ 'yes' => esc_html__( 'Yes', ARVE_SLUG ),
362
+ 'no' => esc_html__( 'No', ARVE_SLUG ),
363
  ),
364
+ 'description' => esc_html__( 'Privacy enhanced mode, will NOT disable cookies but only sets them when a user starts to play a video. There is currently a youtube bug that opens highlighed video boxes with a wrong -nocookie.com url so you need to disble this if you need those.', ARVE_SLUG ),
365
  ),
366
  array(
367
+ 'hide_from_sc' => true,
368
+ 'attr' => 'vimeo_api_token',
369
+ 'label' => esc_html__( 'Video API Token', ARVE_SLUG ),
370
+ 'type' => 'text',
371
+ 'description' => sprintf(
372
  __( 'Needed for <a href="%s">Random Video Addon</a>.', ARVE_SLUG ),
373
  'https://nextgenthemes.local/plugins/arve-random-video/'
374
  ),
391
 
392
  $out = '';
393
 
394
+ foreach ( $modes as $mode => $desc ) {
395
 
396
  $out .= sprintf(
397
  '<option value="%s" %s>%s</option>',
417
  $s = 'https?://(www\.)?';
418
 
419
  $properties = array(
420
+ 'allmyvideos' => array(
421
  'name' => 'allmyvideos.net',
422
  'regex' => $s . 'allmyvideos\.net/(embed-)?(?<id>[a-z0-9]+)',
423
  'embed_url' => 'https://allmyvideos.net/embed-%s.html',
424
+ 'tests' => array(
425
  array(
426
  'url' => 'https://allmyvideos.net/1bno5g9il7ha',
427
+ 'id' => '1bno5g9il7ha',
428
  ),
429
  array(
430
  'url' => 'https://allmyvideos.net/embed-1bno5g9il7ha.html',
431
+ 'id' => '1bno5g9il7ha',
432
  ),
433
  )
434
  ),
435
+ 'alugha' => array(
436
+ 'regex' => $s . 'alugha\.com/(1/)?videos/(?<id>[a-z0-9_\-]+)',
437
+ 'embed_url' => 'https://alugha.com/embed/web-player/?v=%s',
438
  'default_params' => 'nologo=1',
439
  'auto_thumbnail' => true,
440
+ 'tests' => array(
441
  array(
442
  'url' => 'https://alugha.com/1/videos/youtube-54m1YfEuYU8',
443
+ 'id' => 'youtube-54m1YfEuYU8',
444
  ),
445
  array(
446
  'url' => 'https://alugha.com/videos/7cab9cd7-f64a-11e5-939b-c39074d29b86',
447
+ 'id' => '7cab9cd7-f64a-11e5-939b-c39074d29b86',
448
  ),
449
  )
450
  ),
451
+ 'archiveorg' => array(
452
  'name' => 'Archive.org',
453
  'regex' => $s . 'archive\.org/(details|embed)/(?<id>[0-9a-z\-]+)',
454
  'embed_url' => 'https://www.archive.org/embed/%s/',
455
  'default_params' => '',
456
  'auto_thumbnail' => false,
457
+ 'tests' => array(
458
+ array(
459
+ 'url' => 'https://archive.org/details/arashyekt4_gmail_Cat',
460
+ 'id' => 'arashyekt4'
461
+ ),
462
  )
463
  ),
464
+ 'break' => array(
465
  'regex' => 'https?://(www\.|view\.)break\.com/(video/|embed/)?[-a-z0-9]*?(?<id>[0-9]+)',
466
  'embed_url' => 'http://break.com/embed/%s',
467
  'default_params' => 'embed=1',
468
  'auto_thumbnail' => false,
469
+ 'tests' => array(
470
  array(
471
  'url' => 'http://www.break.com/video/first-person-pov-of-tornado-strike-2542591-test',
472
+ 'id' => 2542591,
473
  ),
474
  array(
475
  'url' => 'http://view.break.com/2542591-test',
476
+ 'id' => 2542591,
477
  ),
478
  array(
479
  'url' => 'http://www.break.com/embed/2542591?embed=1',
480
+ 'id' => 2542591,
481
  ),
482
  )
483
  ),
484
+ 'brightcove' => array(
485
+ 'regex' => 'https?://(players|link)\.brightcove\.net/(?<brightcove_account>[0-9]+)/(?<brightcove_player>[a-z0-9]+)_(?<brightcove_embed>[a-z0-9]+)/index\.html\?videoId=(?<id>[0-9]+)',
486
+ 'embed_url' => 'https://players.brightcove.net/%s/%s_%s/index.html?videoId=%s',
487
+ 'requires_src' => true,
488
+ 'tests' => array(
489
  array(
490
+ 'url' => 'http://players.brightcove.net/1160438696001/default_default/index.html?videoId=4587535845001',
491
+ 'brightcove_account' => 1160438696001,
492
+ 'brightcove_player' => 'default',
493
+ 'brightcove_embed' => 'default',
494
+ 'id' => 4587535845001,
495
  ),
496
  array(
497
+ 'url' => 'http://players.brightcove.net/5107476400001/B1xUkhW8i_default/index.html?videoId=5371391223001',
498
+ 'brightcove_account' => 5107476400001,
499
+ 'brightcove_player' => 'B1xUkhW8i',
500
+ 'brightcove_embed' => 'default',
501
+ 'id' => 5371391223001,
502
  ),
503
  ),
504
  ),
505
+ 'collegehumor' => array(
506
  'name' => 'CollegeHumor',
507
  'regex' => $s . 'collegehumor\.com/video/(?<id>[0-9]+)',
508
  'embed_url' => 'http://www.collegehumor.com/e/%s',
509
  'auto_thumbnail' => true,
510
  'auto_title' => true,
511
  'aspect_ratio' => '600:369',
512
+ 'tests' => array(
513
  array(
514
  'url' => 'http://www.collegehumor.com/video/6854928/troopers-holopad',
515
  'id' => 6854928,
517
  ),
518
  )
519
  ),
520
+ 'comedycentral' => array(
521
  'name' => 'Comedy Central',
522
  'regex' => 'https?://media\.mtvnservices\.com/embed/mgid:arc:video:comedycentral\.com:(?<id>[-a-z0-9]{36})',
523
  'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:%s',
524
  'requires_src' => true,
525
  'auto_thumbnail' => false,
526
+ 'tests' => array(
527
  array(
528
  'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c80adf02-3e24-437a-8087-d6b77060571c',
529
+ 'id' => 'c80adf02-3e24-437a-8087-d6b77060571c',
530
  ),
531
  array(
532
  'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
533
+ 'id' => 'c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
534
  ),
535
  )
536
  ),
537
+ 'dailymotion' => array(
538
  'regex' => $s . '(dai\.ly|dailymotion\.com/video)/(?<id>[a-z0-9]+)',
539
  'embed_url' => 'https://www.dailymotion.com/embed/video/%s',
540
  'default_params' => 'logo=0&hideInfos=1&related=0',
541
  'auto_thumbnail' => true,
542
  'auto_title' => true,
543
+ 'tests' => array(
544
  array(
545
  'url' => 'http://www.dailymotion.com/video/x41ia79_mass-effect-andromeda-gameplay-alpha_videogames',
546
+ 'id' => 'x41ia79',
547
  'oembed_title' => 'Mass Effect Andromeda - Gameplay Alpha',
548
  ),
549
  array(
550
  'url' => 'http://dai.ly/x3cwlqz',
551
+ 'id' => 'x3cwlqz',
552
  'oembed_title' => 'Mass Effect Andromeda',
553
  ),
554
  ),
558
  'type' => 'bool',
559
  ),
560
  ),
561
+ 'query_argss' => array(
562
+ 'api' => array( 0, 1 ),
563
+ 'autoplay' => array( 0, 1 ),
564
+ 'chromeless' => array( 0, 1 ),
565
+ 'highlight' => array( 0, 1 ),
566
+ 'html' => array( 0, 1 ),
567
+ 'id' => 'int',
568
+ 'info' => array( 0, 1 ),
569
+ 'logo' => array( 0, 1 ),
570
+ 'network' => array( 'dsl', 'cellular' ),
571
+ 'origin' => array( 0, 1 ),
572
+ 'quality' => array( 240, 380, 480, 720, 1080, 1440, 2160 ),
573
+ 'related' => array( 0, 1 ),
574
+ 'start' => 'int',
575
+ 'startscreen' => array( 0, 1 ),
576
+ 'syndication' => 'int',
577
+ 'webkit-playsinline' => array( 0, 1 ),
578
+ 'wmode' => array( 'direct', 'opaque' ),
579
  ),
580
  ),
581
+ 'dailymotionlist' => array(
582
  # http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45
583
  # http://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2Fx3yk8p_PHIL-MDS_nature-et-environnement-2011%2F1&&autoplay=0&mute=0
584
 
585
+ 'regex' => $s . 'dailymotion\.com/playlist/(?<id>[a-z0-9]+)',
586
+ 'embed_url' => 'https://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2F%s%2F1&',
587
+ 'auto_thumbnail' => false,
588
+ 'tests' => array(
589
  array(
590
  'url' => 'http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45',
591
+ 'id' => 'x3yk8p',
592
  )
593
  )
594
  ),
595
+ 'facebook' => array(
596
  # https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater
597
  #<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FTheKillingsOfTonyBlair%2Fvideos%2Fvb.551089058285349%2F562955837098671%2F%3Ftype%3D2%26theater&width=500&show_text=false&height=280&appId" width="500" height="280" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
598
+ 'regex' => '(?<id>https?://([a-z]+\.)?facebook\.com/[-.a-z0-9]+/videos/[a-z.0-9/]+)',
599
+ 'url_encode_id' => true,
600
+ 'embed_url' => 'https://www.facebook.com/plugins/video.php?href=%s',
601
+ 'auto_thumbnail' => true,
602
+ 'tests' => array(
 
603
  array(
604
+ 'url' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater',
605
+ 'id' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/',
606
  ),
607
  array(
608
+ 'url' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
609
+ 'id' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
610
  ),
611
  ),
612
  ),
613
+ 'funnyordie' => array(
614
  'name' => 'Funny or Die',
615
  'regex' => $s . 'funnyordie\.com/videos/(?<id>[a-z0-9_]+)',
616
  'embed_url' => 'https://www.funnyordie.com/embed/%s',
617
  'auto_thumbnail' => true,
618
  'auto_title' => true,
619
  'aspect_ratio' => '640:400',
620
+ 'tests' => array(
621
  array(
622
  'url' => 'http://www.funnyordie.com/videos/76585438d8/sarah-silverman-s-we-are-miracles-hbo-special',
623
+ 'id' => '76585438d8',
624
  'oembed_title' => "Sarah Silverman's - We Are Miracles HBO Special",
625
  ),
626
  )
627
  ),
628
+ 'ign' => array(
629
  'name' => 'IGN',
630
  'regex' => '(?<id>' . $s . 'ign\.com/videos/[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9a-z\-]+)',
631
  'embed_url' => 'http://widgets.ign.com/video/embed/content.html?url=%s',
632
  'auto_thumbnail' => false,
633
+ 'tests' => array(
634
  array(
635
+ 'url' => 'http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
636
+ 'id' => 'http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  ),
638
  )
639
  ),
640
+ #https://cdnapisec.kaltura.com/p/243342/sp/24334200/embedIframeJs/uiconf_id/20540612/partner_id/243342?iframeembed=true&playerId=kaltura_player&entry_id=1_sf5ovm7u&flashvars[streamerType]=auto" width="560" height="395" allowfullscreen webkitallowfullscreen mozAllowFullScreen frameborder="0"></iframe>
641
+ 'kickstarter' => array(
642
+ 'regex' => $s . 'kickstarter\.com/projects/(?<id>[0-9a-z\-]+/[-0-9a-z\-]+)',
643
+ 'embed_url' => 'https://www.kickstarter.com/projects/%s/widget/video.html',
644
+ 'auto_thumbnail' => false,
645
+ 'tests' => array(
646
+ array(
647
+ 'url' => 'https://www.kickstarter.com/projects/obsidian/project-eternity?ref=discovery',
648
+ 'id' => 'obsidian/project-eternity'
649
+ ),
650
+ array(
651
+ 'url' => 'https://www.kickstarter.com/projects/trinandtonic/friendship-postcards?ref=category_featured',
652
+ 'id' => 'trinandtonic/friendship-postcards'
653
+ ),
654
+ )
655
+ ),
656
+ 'liveleak' => array(
657
  'name' => 'LiveLeak',
658
  'regex' => $s . 'liveleak\.com/(view|ll_embed)\?(?<id>(f|i)=[0-9a-z\_]+)',
659
  'embed_url' => 'https://www.liveleak.com/ll_embed?%s',
660
  'default_params' => '',
661
  'auto_thumbnail' => true,
662
+ 'tests' => array(
663
+ array(
664
+ 'url' => 'http://www.liveleak.com/view?i=703_1385224413',
665
+ 'id' => 'i=703_1385224413'
666
+ ), # Page/item 'i=' URL
667
+ array(
668
+ 'url' => 'http://www.liveleak.com/view?f=c85bdf5e45b2',
669
+ 'id' => 'f=c85bdf5e45b2'
670
+ ), #File f= URL
671
  ),
672
+ 'test_ids' => array(
673
  'f=c85bdf5e45b2',
674
  'c85bdf5e45b2'
675
  ),
676
  ),
677
+ 'livestream' => array(
678
  'regex' => $s . 'livestream\.com/accounts/(?<id>[0-9]+/events/[0-9]+(/videos/[0-9]+)?)',
679
  'embed_url' => 'https://livestream.com/accounts/%s/player',
680
  'default_params' => 'width=1280&height=720&enableInfoAndActivity=true&defaultDrawer=&mute=false',
681
  'auto_thumbnail' => false,
682
+ 'tests' => array(
683
  # https://livestream.com/accounts/23470201/events/7021166
684
  # <iframe id="ls_embed_1491401341" src="https://livestream.com/accounts/4683311/events/3747538/player?width=640&height=360&enableInfoAndActivity=true&defaultDrawer=&autoPlay=true&mute=false" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen> </iframe>
685
  # https://livestream.com/DemocracyNow/dirtywars/videos/17500857
686
  # <iframe id="ls_embed_1491412166" src="https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen> </iframe>
687
+ array(
688
+ 'url' => 'https://livestream.com/accounts/23470201/events/7021166',
689
+ 'id' => '23470201/events/7021166'
690
+ ),
691
+ array(
692
+ 'url' => 'https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false',
693
+ 'id' => '467901/events/2015991/videos/17500857'
694
+ ),
695
  ),
696
  ),
697
+ 'klatv' => array(
698
  'regex' => $s . 'kla(gemauer)?.tv/(?<id>[0-9]+)',
699
  'embed_url' => 'https://www.kla.tv/index.php?a=showembed&vidid=%s',
700
  'name' => 'kla.tv',
701
  'url' => true,
702
  'auto_thumbnail' => false,
703
+ 'tests' => array(
704
+ array(
705
+ 'url' => 'http://www.klagemauer.tv/9106',
706
+ 'id' => 9106
707
+ ),
708
+ array(
709
+ 'url' => 'http://www.kla.tv/9122',
710
+ 'id' => 9122
711
+ ),
712
  ),
713
  ),
714
+ 'metacafe' => array(
715
  'regex' => $s . 'metacafe\.com/(watch|fplayer)/(?<id>[0-9]+)',
716
  'embed_url' => 'http://www.metacafe.com/embed/%s/',
717
  'auto_thumbnail' => false,
718
+ 'tests' => array(
719
+ array(
720
+ 'url' => 'http://www.metacafe.com/watch/11433151/magical-handheld-fireballs/',
721
+ 'id' => 11433151
722
+ ),
723
+ array(
724
+ 'url' => 'http://www.metacafe.com/watch/11322264/everything_wrong_with_robocop_in_7_minutes/',
725
+ 'id' => 11322264
726
+ ),
727
  ),
728
  ),
729
+ 'movieweb' => array(
730
  'regex' => $s . 'movieweb\.com/v/(?<id>[a-z0-9]{14})',
731
  'embed_url' => 'http://movieweb.com/v/%s/embed',
732
  'auto_thumbnail' => false,
733
  'requires_src' => true,
734
+ 'tests' => array(
735
+ array(
736
+ 'url' => 'http://movieweb.com/v/VIOF6ytkiMEMSR/embed',
737
+ 'id' => 'VIOF6ytkiMEMSR'
738
+ ),
739
  ),
740
  ),
741
+ 'myspace' => array(
742
  #<iframe width="480" height="270" src="//media.myspace.com/play/video/house-of-lies-season-5-premiere-109903807-112606834" frameborder="0" allowtransparency="true" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><p><a href="https://media.myspace.com/showtime/video/house-of-lies-season-5-premiere/109903807">House of Lies Season 5 Premiere</a> from <a href="https://media.myspace.com/Showtime">Showtime</a> on <a href="https://media.myspace.com">Myspace</a>.</p>
743
  'regex' => $s . 'myspace\.com/.+/(?<id>[0-9]+)',
744
  'embed_url' => 'https://media.myspace.com/play/video/%s',
745
  'auto_thumbnail' => false,
746
+ 'tests' => array(
747
+ array(
748
+ 'url' => 'https://myspace.com/myspace/video/dark-rooms-the-shadow-that-looms-o-er-my-heart-live-/109471212',
749
+ 'id' => 109471212
750
+ ),
751
  )
752
  ),
753
+ 'snotr' => array(
754
  'regex' => $s . 'snotr\.com/(video|embed)/(?<id>[0-9]+)',
755
  'embed_url' => 'http://www.snotr.com/embed/%s',
756
  'auto_thumbnail' => false,
757
+ 'tests' => array(
758
  array(
759
  'url' => 'http://www.snotr.com/video/12314/How_big_a_truck_blind_spot_really_is',
760
+ 'id' => 12314,
761
  ),
762
  )
763
  ),
764
+ 'spike' => array(
765
  'regex' => 'https?://media.mtvnservices.com/embed/mgid:arc:video:spike\.com:(?<id>[a-z0-9\-]{36})',
766
  'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:%s',
767
  'requires_src' => true,
768
  'auto_thumbnail' => false,
769
+ 'tests' => array(
770
  array(
771
  'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:6a219882-c412-46ce-a8c9-32e043396621',
772
+ 'id' => '6a219882-c412-46ce-a8c9-32e043396621',
773
  ),
774
  ),
775
  ),
776
+ 'ted' => array(
777
  'name' => 'TED Talks',
778
  'regex' => $s . 'ted\.com/talks/(?<id>[a-z0-9_]+)',
779
  'embed_url' => 'https://embed-ssl.ted.com/talks/%s.html',
780
  'auto_thumbnail' => true,
781
  'auto_title' => true,
782
+ 'tests' => array(
783
  array(
784
  'url' => 'https://www.ted.com/talks/margaret_stewart_how_youtube_thinks_about_copyright',
785
+ 'id' => 'margaret_stewart_how_youtube_thinks_about_copyright'
786
  ),
787
  ),
788
  ),
789
+ 'twitch' => array(
790
  'regex' => $s . 'twitch.tv/(?!directory)(?|[a-z0-9_]+/v/(?<id>[0-9]+)|(?<id>[a-z0-9_]+))',
791
  'embed_url' => 'https://player.twitch.tv/?channel=%s', # if numeric id https://player.twitch.tv/?video=v%s
792
  'auto_thumbnail' => true,
793
+ 'tests' => array(
794
  array(
795
  'url' => 'https://www.twitch.tv/whiskeyexperts',
796
  'id' => 'whiskeyexperts',
797
  'api_img_contains' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/whiskyexperts',
798
  ),
799
  array(
800
+ 'url' => 'https://www.twitch.tv/imaqtpie',
801
+ 'id' => 'imaqtpie',
802
  'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
803
  ),
804
  array(
805
+ 'url' => 'https://www.twitch.tv/imaqtpie/v/95318019',
806
+ 'id' => 95318019,
807
  'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
808
  ),
809
  ),
810
  ),
811
+ 'ustream' => array(
812
  'regex' => $s . 'ustream\.tv/(embed/)?(channel/)?(?<id>[0-9]+|recorded/[0-9]+(/highlight/[0-9]+)?)',
813
  'embed_url' => 'http://www.ustream.tv/embed/%s',
814
  'default_params' => 'html5ui',
815
  'auto_thumbnail' => false,
816
  'aspect_ratio' => '480:270',
817
+ 'tests' => array(
818
  array(
819
  'url' => 'http://www.ustream.tv/recorded/59999872?utm_campaign=ustre.am&utm_source=ustre.am/:43KHS&utm_medium=social&utm_content=20170405204127',
820
+ 'id' => 'recorded/59999872'
821
  ),
822
  array(
823
  'url' => 'http://www.ustream.tv/embed/17074538?wmode=transparent&v=3&autoplay=false',
824
+ 'id' => '17074538'
825
  ),
826
  ),
827
  ),
828
+ 'rutube' => array(
829
+ 'name' => 'RuTube.ru',
830
+ 'regex' => $s . 'rutube\.ru/play/embed/(?<id>[0-9]+)',
831
+ 'embed_url' => 'https://rutube.ru/play/embed/%s',
832
+ 'tests' => array(
833
  array(
834
  'url' => 'https://rutube.ru/play/embed/9822149',
835
+ 'id' => '9822149'
836
  ),
837
  ),
838
  ),
839
+ 'veoh' => array(
840
  'regex' => $s . 'veoh\.com/watch/(?<id>[a-z0-9]+)',
841
  'embed_url' => 'http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1396&permalinkId=%s',
842
  'default_params' => 'player=videodetailsembedded&id=anonymous',
843
  'auto_thumbnail' => false,
844
+ 'tests' => array(
 
845
  array(
846
  'url' => 'http://www.veoh.com/watch/v19866882CAdjNF9b',
847
+ 'id' => 'v19866882CAdjNF9b'
848
  ),
849
  )
850
  ),
851
+ 'vevo' => array(
852
  'regex' => $s . 'vevo\.com/watch/([^\/]+/[^\/]+/)?(?<id>[a-z0-9]+)',
853
  'embed_url' => 'https://scache.vevo.com/assets/html/embed.html?video=%s',
854
  'default_params' => 'playlist=false&playerType=embedded&env=0',
855
  'auto_thumbnail' => false,
856
+ 'tests' => array(
857
  array(
858
+ 'url' => 'https://www.vevo.com/watch/the-offspring/the-kids-arent-alright/USSM20100649',
859
+ 'id' => 'USSM20100649'
860
  ),
 
 
861
  ),
862
  ),
863
+ 'viddler' => array(
864
  'regex' => $s . 'viddler\.com/(embed|v)/(?<id>[a-z0-9]{8})',
 
 
865
  'embed_url' => 'https://www.viddler.com/embed/%s/',
866
  'default_params' => '?f=1&player=full&secret=59822701&disablebackwardseek=false&disableseek=false&disableforwardseek=false&make_responsive=false&loop=false&nologo=false&hd=false',
867
  'auto_thumbnail' => false,
868
  'auto_title' => false,
869
  'aspect_ratio' => '545:349',
870
+ 'tests' => array(
871
  array(
872
  'url' => 'https://www.viddler.com/v/a695c468',
873
+ 'id' => 'a695c468'
874
  ),
875
  ),
876
  ),
877
+ 'vidspot' => array(
878
  'name' => 'vidspot.net',
879
  'regex' => $s . 'vidspot\.net/(embed-)?(?<id>[a-z0-9]+)',
880
  'embed_url' => 'http://vidspot.net/embed-%s.html',
881
+ 'tests' => array(
882
+ array(
883
+ 'url' => 'http://vidspot.net/285wf9uk3rry',
884
+ 'id' => '285wf9uk3rry'
885
+ ),
886
+ array(
887
+ 'url' => 'http://vidspot.net/embed-285wf9uk3rry.html',
888
+ 'id' => '285wf9uk3rry'
889
+ ),
890
  ),
891
  ),
892
+ 'vine' => array(
893
  'regex' => $s . 'vine\.co/v/(?<id>[a-z0-9]+)',
894
  'embed_url' => 'https://vine.co/v/%s/embed/simple',
895
  'default_params' => '', //* audio=1 supported
896
  'auto_thumbnail' => false,
897
  'aspect_ratio' => '1:1',
898
+ 'tests' => array(
899
+ array(
900
+ 'url' => 'https://vine.co/v/bjAaLxQvOnQ',
901
+ 'id' => 'bjAaLxQvOnQ'
902
+ ),
903
+ array(
904
+ 'url' => 'https://vine.co/v/MbrreglaFrA',
905
+ 'id' => 'MbrreglaFrA'
906
+ ),
907
+ array(
908
+ 'url' => 'https://vine.co/v/bjHh0zHdgZT/embed',
909
+ 'id' => 'bjHh0zHdgZT'
910
+ ),
911
  ),
912
  ),
913
+ 'vimeo' => array(
914
  'regex' => 'https?://(player\.)?vimeo\.com/((video/)|(channels/[a-z]+/)|(groups/[a-z]+/videos/))?(?<id>[0-9]+)(?<vimeo_secret>/[0-9a-z]+)?',
915
  'embed_url' => 'https://player.vimeo.com/video/%s',
916
  'default_params' => 'html5=1&title=1&byline=0&portrait=0',
917
  'auto_thumbnail' => true,
918
  'auto_title' => true,
919
+ 'tests' => array(
920
+ array(
921
+ 'url' => 'https://vimeo.com/124400795',
922
+ 'id' => 124400795
923
+ ),
924
+ array(
925
+ 'url' => 'https://player.vimeo.com/124400795',
926
+ 'id' => 124400795
927
+ ),
 
 
 
 
 
928
  ),
 
929
  ),
930
+ 'vk' => array(
931
+ 'name' => 'VK',
 
 
932
  'regex' => $s . 'vk\.com/video_ext\.php\?(?<id>[^ ]+)',
933
  'embed_url' => 'https://vk.com/video_ext.php?%s',
934
  'requires_src' => true,
935
  'auto_thumbnail' => false,
936
+ 'tests' => array(
937
  array(
938
  'url' => 'https://vk.com/video_ext.php?oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1',
939
+ 'id' => 'oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1'
940
  ),
941
  ),
942
  ),
943
+ 'vzaar' => array(
944
  'regex' => $s . 'vzaar.(com|tv)/(videos/)?(?<id>[0-9]+)',
945
  'embed_url' => 'https://view.vzaar.com/%s/player',
946
+ 'tests' => array(
947
+ array(
948
+ 'url' => 'https://vzaar.com/videos/993324',
949
+ 'id' => 993324
950
+ ),
951
+ array(
952
+ 'url' => 'https://vzaar.com/videos/1515906',
953
+ 'id' => 1515906
954
+ ),
955
  ),
956
  ),
957
+ 'wistia' => array(
 
958
  'regex' => 'https?://fast\.wistia\.net/embed/iframe/(?<id>[a-z0-9]+)',
959
  'embed_url' => 'https://fast.wistia.net/embed/iframe/%s',
960
  'default_params' => 'videoFoam=true',
961
+ 'tests' => array(
962
  array(
963
  'url' => 'https://fast.wistia.net/embed/iframe/g5pnf59ala?videoFoam=true',
964
+ 'id' => 'g5pnf59ala'
965
  ),
966
  ),
967
  ),
968
+ 'xtube' => array(
969
  'name' => 'XTube',
970
  'regex' => $s . 'xtube\.com/watch\.php\?v=(?<id>[a-z0-9_\-]+)',
971
  'embed_url' => 'http://www.xtube.com/embedded/user/play.php?v=%s',
972
  'auto_thumbnail' => false,
973
+ 'tests' => array(
974
+ array(
975
+ 'url' => 'http://www.xtube.com/watch.php?v=1234',
976
+ 'id' => 1234
977
+ ),
978
  ),
979
  ),
980
+ 'yahoo' => array(
981
  'regex' => '(?<id>https?://([a-z.]+)yahoo\.com/[/-a-z0-9öäü]+\.html)',
982
  'embed_url' => '%s',
983
  'default_params' => 'format=embed',
984
  'auto_thumbnail' => true,
985
  'auto_title' => true,
986
+ 'tests' => array(
987
  array(
988
  'url' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html?format=embed&player_autoplay=false',
989
  'id' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html'
990
  ),
991
  array(
992
  'url' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html?format=embed',
993
+ 'id' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html'
994
  ),
995
  )
996
  ),
997
+ 'youku' => array(
998
  'regex' => 'https?://([a-z.]+)?\.youku.com/(embed/|v_show/id_)(?<id>[a-z0-9]+)',
999
  'embed_url' => 'https://player.youku.com/embed/%s',
1000
  'auto_thumbnail' => false,
1001
+ 'tests' => array(
 
1002
  array(
1003
  'url' => 'http://v.youku.com/v_show/id_XMTczMDAxMjIyNA==.html?f=27806190',
1004
+ 'id' => 'XMTczMDAxMjIyNA',
1005
  ),
1006
  array(
1007
  'url' => 'http://player.youku.com/embed/XMTUyODYwOTc4OA==',
1008
+ 'id' => 'XMTUyODYwOTc4OA',
1009
  ),
1010
  ),
1011
  ),
1012
+ 'youtube' => array(
1013
  'name' => 'YouTube',
1014
  'regex' => $s . '(youtube\.com\/\S*((\/e(mbed))?\/|watch\?(\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11}((\?|&)list=[a-z0-9_\-]+)?)',
1015
  'embed_url' => 'https://www.youtube.com/embed/%s',
1016
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1017
  'auto_thumbnail' => true,
1018
  'auto_title' => true,
1019
+ 'tests' => array(
 
1020
  array(
1021
+ 'url' => 'https://youtu.be/dqLyB5srdGI',
1022
+ 'id' => 'dqLyB5srdGI',
1023
  ),
1024
  array(
1025
  'url' => 'https://www.youtube.com/watch?v=-fEo3kgHFaw',
1026
+ 'id' => '-fEo3kgHFaw',
1027
  ),
1028
  array(
1029
  'url' => 'http://www.youtube.com/watch?v=vrXgLhkv21Y',
1030
+ 'id' => 'vrXgLhkv21Y',
1031
  'oembed_title' => 'TerrorStorm Full length version',
1032
  ),
1033
  array(
1034
  'url' => 'https://youtu.be/hRonZ4wP8Ys',
1035
+ 'id' => 'hRonZ4wP8Ys',
1036
  'oembed_title' => 'One Bright Dot',
1037
  ),
1038
  array(
1039
  'url' => 'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10', # The index part will be ignored
1040
+ 'id' => 'GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA'
1041
  ),
1042
  array(
1043
  'url' => 'https://youtu.be/b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg',
1044
+ 'id' => 'b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg'
1045
  ),
1046
  ),
1047
  'specific_tests' => array(
1048
+ __( 'URL from youtu.be shortener', ARVE_SLUG ),
1049
  'http://youtu.be/3Y8B93r2gKg',
1050
+ __( 'Youtube playlist URL inlusive the video to start at. The index part will be ignored and is not needed', ARVE_SLUG ),
1051
  'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10',
1052
+ __( 'Loop a YouTube video', ARVE_SLUG ),
1053
  '[youtube id="FKkejo2dMV4" parameters="playlist=FKkejo2dMV4&loop=1"]',
1054
+ __( 'Enable annotations and related video at the end (disable by default with this plugin)', ARVE_SLUG ),
1055
  '[youtube id="uCQXKYPiz6M" parameters="iv_load_policy=1"]',
1056
+ __( 'Testing Youtube Starttimes', ARVE_SLUG ),
1057
  'http://youtu.be/vrXgLhkv21Y?t=1h19m14s',
1058
  'http://youtu.be/vrXgLhkv21Y?t=19m14s',
1059
  'http://youtu.be/vrXgLhkv21Y?t=1h',
1062
  __( 'The Parameter start only takes values in seconds, this will start the video at 1 minute and 1 second', ARVE_SLUG ),
1063
  '[youtube id="uCQXKYPiz6M" parameters="start=61"]',
1064
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1065
  ),
1066
+ 'youtubelist' => array(
1067
  'regex' => $s . 'youtube\.com/(embed/videoseries|playlist)\?list=(?<id>[-a-z0-9_]+)',
1068
  'name' => 'YouTube Playlist',
1069
  'embed_url' => 'https://www.youtube.com/embed/videoseries?list=%s',
1070
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1071
  'auto_thumbnail' => true,
1072
+ 'tests' => array(
1073
  array(
1074
  'url' => 'https://www.youtube.com/playlist?list=PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7',
1075
+ 'id' => 'PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7'
1076
  ),
1077
  array(
1078
  'url' => 'https://www.youtube.com/embed/videoseries?list=PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
1079
+ 'id' => 'PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
1080
  )
1081
  )
1082
  ),
1083
+ 'html5' => array(
1084
  'name' => 'HTML5 video files directly',
 
1085
  'aspect_ratio' => false,
1086
  ),
1087
+ 'iframe' => array(
1088
  'embed_url' => '%s',
1089
  'default_params' => '',
1090
  'auto_thumbnail' => false,
1091
+ 'tests' => array(
1092
+ array(
1093
+ 'url' => 'https://example.com/',
1094
+ 'id' => 'https://example.com/'
1095
+ ),
1096
  ),
1097
  ),
1098
+ 'google_drive' => array( 'name', 'Google Drive' ),
1099
+ 'dropbox' => null,
1100
+ 'ooyala' => null,
1101
  );
1102
 
1103
  foreach ( $properties as $key => $value ) {
1104
 
1105
+ if ( empty( $value['name'] ) ) {
1106
  $properties[ $key ]['name'] = ucfirst( $key );
1107
  }
1108
+ if ( ! isset( $value['aspect_ratio'] ) ) {
1109
  $properties[ $key ]['aspect_ratio'] = '16:9';
1110
  }
1111
  }
1127
  continue;
1128
  } elseif ( '' === $value || true === $value ) {
1129
  $html .= sprintf( ' %s', esc_html( $key ) );
1130
+ } elseif ( in_array( $key, array( 'href', 'data-href', 'src', 'data-src' ), true ) ) {
1131
  $html .= sprintf( ' %s="%s"', esc_html( $key ), arve_esc_url( $value ) );
1132
  } else {
1133
  $html .= sprintf( ' %s="%s"', esc_html( $key ), esc_attr( $value ) );
1143
 
1144
  function arve_starts_with( $haystack, $needle ) {
1145
  // search backwards starting from haystack length characters from the end
1146
+ return $needle === '' || strrpos( $haystack, $needle, -strlen( $haystack ) ) !== false; // phpcs:ignore WordPress.PHP.YodaConditions.NotYoda
1147
  }
1148
 
1149
  function arve_ends_with( $haystack, $needle ) {
1150
  // search forward starting from end minus needle length characters
1151
+ return $needle === '' || ( ( $temp = strlen( $haystack ) - strlen( $needle ) ) >= 0 && strpos( $haystack, $needle, $temp ) !== false ); // phpcs:ignore
1152
  }
1153
 
1154
  function arve_contains( $haystack, $needle ) {
1155
+ return strpos( $haystack, $needle ) !== false;
1156
  }
1157
 
1158
  function arve_register_asset( $args ) {
1159
 
1160
  $defaults = array(
1161
+ 'handle' => null,
1162
+ 'src' => null,
1163
+ 'deps' => array(),
1164
+ 'in_footer' => true,
1165
+ 'media' => null,
1166
+ 'ver' => ARVE_VERSION,
1167
+ 'automin' => false,
1168
  );
1169
 
1170
  $args = wp_parse_args( $args, $defaults );
shared/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
vendor/autoload.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInitfb499b858061dcbc3a5ecc8995cf88b8::getLoader();
 
 
 
 
 
 
 
vendor/composer/ClassLoader.php DELETED
@@ -1,445 +0,0 @@
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\Autoload;
14
-
15
- /**
16
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
- *
18
- * $loader = new \Composer\Autoload\ClassLoader();
19
- *
20
- * // register classes with namespaces
21
- * $loader->add('Symfony\Component', __DIR__.'/component');
22
- * $loader->add('Symfony', __DIR__.'/framework');
23
- *
24
- * // activate the autoloader
25
- * $loader->register();
26
- *
27
- * // to enable searching the include path (eg. for PEAR packages)
28
- * $loader->setUseIncludePath(true);
29
- *
30
- * In this example, if you try to use a class in the Symfony\Component
31
- * namespace or one of its children (Symfony\Component\Console for instance),
32
- * the autoloader will first look for the class under the component/
33
- * directory, and it will then fallback to the framework/ directory if not
34
- * found before giving up.
35
- *
36
- * This class is loosely based on the Symfony UniversalClassLoader.
37
- *
38
- * @author Fabien Potencier <fabien@symfony.com>
39
- * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
- */
43
- class ClassLoader
44
- {
45
- // PSR-4
46
- private $prefixLengthsPsr4 = array();
47
- private $prefixDirsPsr4 = array();
48
- private $fallbackDirsPsr4 = array();
49
-
50
- // PSR-0
51
- private $prefixesPsr0 = array();
52
- private $fallbackDirsPsr0 = array();
53
-
54
- private $useIncludePath = false;
55
- private $classMap = array();
56
- private $classMapAuthoritative = false;
57
- private $missingClasses = array();
58
- private $apcuPrefix;
59
-
60
- public function getPrefixes()
61
- {
62
- if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
- }
65
-
66
- return array();
67
- }
68
-
69
- public function getPrefixesPsr4()
70
- {
71
- return $this->prefixDirsPsr4;
72
- }
73
-
74
- public function getFallbackDirs()
75
- {
76
- return $this->fallbackDirsPsr0;
77
- }
78
-
79
- public function getFallbackDirsPsr4()
80
- {
81
- return $this->fallbackDirsPsr4;
82
- }
83
-
84
- public function getClassMap()
85
- {
86
- return $this->classMap;
87
- }
88
-
89
- /**
90
- * @param array $classMap Class to filename map
91
- */
92
- public function addClassMap(array $classMap)
93
- {
94
- if ($this->classMap) {
95
- $this->classMap = array_merge($this->classMap, $classMap);
96
- } else {
97
- $this->classMap = $classMap;
98
- }
99
- }
100
-
101
- /**
102
- * Registers a set of PSR-0 directories for a given prefix, either
103
- * appending or prepending to the ones previously set for this prefix.
104
- *
105
- * @param string $prefix The prefix
106
- * @param array|string $paths The PSR-0 root directories
107
- * @param bool $prepend Whether to prepend the directories
108
- */
109
- public function add($prefix, $paths, $prepend = false)
110
- {
111
- if (!$prefix) {
112
- if ($prepend) {
113
- $this->fallbackDirsPsr0 = array_merge(
114
- (array) $paths,
115
- $this->fallbackDirsPsr0
116
- );
117
- } else {
118
- $this->fallbackDirsPsr0 = array_merge(
119
- $this->fallbackDirsPsr0,
120
- (array) $paths
121
- );
122
- }
123
-
124
- return;
125
- }
126
-
127
- $first = $prefix[0];
128
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
-
131
- return;
132
- }
133
- if ($prepend) {
134
- $this->prefixesPsr0[$first][$prefix] = array_merge(
135
- (array) $paths,
136
- $this->prefixesPsr0[$first][$prefix]
137
- );
138
- } else {
139
- $this->prefixesPsr0[$first][$prefix] = array_merge(
140
- $this->prefixesPsr0[$first][$prefix],
141
- (array) $paths
142
- );
143
- }
144
- }
145
-
146
- /**
147
- * Registers a set of PSR-4 directories for a given namespace, either
148
- * appending or prepending to the ones previously set for this namespace.
149
- *
150
- * @param string $prefix The prefix/namespace, with trailing '\\'
151
- * @param array|string $paths The PSR-4 base directories
152
- * @param bool $prepend Whether to prepend the directories
153
- *
154
- * @throws \InvalidArgumentException
155
- */
156
- public function addPsr4($prefix, $paths, $prepend = false)
157
- {
158
- if (!$prefix) {
159
- // Register directories for the root namespace.
160
- if ($prepend) {
161
- $this->fallbackDirsPsr4 = array_merge(
162
- (array) $paths,
163
- $this->fallbackDirsPsr4
164
- );
165
- } else {
166
- $this->fallbackDirsPsr4 = array_merge(
167
- $this->fallbackDirsPsr4,
168
- (array) $paths
169
- );
170
- }
171
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
- // Register directories for a new namespace.
173
- $length = strlen($prefix);
174
- if ('\\' !== $prefix[$length - 1]) {
175
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
- }
177
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
- } elseif ($prepend) {
180
- // Prepend directories for an already registered namespace.
181
- $this->prefixDirsPsr4[$prefix] = array_merge(
182
- (array) $paths,
183
- $this->prefixDirsPsr4[$prefix]
184
- );
185
- } else {
186
- // Append directories for an already registered namespace.
187
- $this->prefixDirsPsr4[$prefix] = array_merge(
188
- $this->prefixDirsPsr4[$prefix],
189
- (array) $paths
190
- );
191
- }
192
- }
193
-
194
- /**
195
- * Registers a set of PSR-0 directories for a given prefix,
196
- * replacing any others previously set for this prefix.
197
- *
198
- * @param string $prefix The prefix
199
- * @param array|string $paths The PSR-0 base directories
200
- */
201
- public function set($prefix, $paths)
202
- {
203
- if (!$prefix) {
204
- $this->fallbackDirsPsr0 = (array) $paths;
205
- } else {
206
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
- }
208
- }
209
-
210
- /**
211
- * Registers a set of PSR-4 directories for a given namespace,
212
- * replacing any others previously set for this namespace.
213
- *
214
- * @param string $prefix The prefix/namespace, with trailing '\\'
215
- * @param array|string $paths The PSR-4 base directories
216
- *
217
- * @throws \InvalidArgumentException
218
- */
219
- public function setPsr4($prefix, $paths)
220
- {
221
- if (!$prefix) {
222
- $this->fallbackDirsPsr4 = (array) $paths;
223
- } else {
224
- $length = strlen($prefix);
225
- if ('\\' !== $prefix[$length - 1]) {
226
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
- }
228
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
- }
231
- }
232
-
233
- /**
234
- * Turns on searching the include path for class files.
235
- *
236
- * @param bool $useIncludePath
237
- */
238
- public function setUseIncludePath($useIncludePath)
239
- {
240
- $this->useIncludePath = $useIncludePath;
241
- }
242
-
243
- /**
244
- * Can be used to check if the autoloader uses the include path to check
245
- * for classes.
246
- *
247
- * @return bool
248
- */
249
- public function getUseIncludePath()
250
- {
251
- return $this->useIncludePath;
252
- }
253
-
254
- /**
255
- * Turns off searching the prefix and fallback directories for classes
256
- * that have not been registered with the class map.
257
- *
258
- * @param bool $classMapAuthoritative
259
- */
260
- public function setClassMapAuthoritative($classMapAuthoritative)
261
- {
262
- $this->classMapAuthoritative = $classMapAuthoritative;
263
- }
264
-
265
- /**
266
- * Should class lookup fail if not found in the current class map?
267
- *
268
- * @return bool
269
- */
270
- public function isClassMapAuthoritative()
271
- {
272
- return $this->classMapAuthoritative;
273
- }
274
-
275
- /**
276
- * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
- *
278
- * @param string|null $apcuPrefix
279
- */
280
- public function setApcuPrefix($apcuPrefix)
281
- {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
- }
284
-
285
- /**
286
- * The APCu prefix in use, or null if APCu caching is not enabled.
287
- *
288
- * @return string|null
289
- */
290
- public function getApcuPrefix()
291
- {
292
- return $this->apcuPrefix;
293
- }
294
-
295
- /**
296
- * Registers this instance as an autoloader.
297
- *
298
- * @param bool $prepend Whether to prepend the autoloader or not
299
- */
300
- public function register($prepend = false)
301
- {
302
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
- }
304
-
305
- /**
306
- * Unregisters this instance as an autoloader.
307
- */
308
- public function unregister()
309
- {
310
- spl_autoload_unregister(array($this, 'loadClass'));
311
- }
312
-
313
- /**
314
- * Loads the given class or interface.
315
- *
316
- * @param string $class The name of the class
317
- * @return bool|null True if loaded, null otherwise
318
- */
319
- public function loadClass($class)
320
- {
321
- if ($file = $this->findFile($class)) {
322
- includeFile($file);
323
-
324
- return true;
325
- }
326
- }
327
-
328
- /**
329
- * Finds the path to the file where the class is defined.
330
- *
331
- * @param string $class The name of the class
332
- *
333
- * @return string|false The path if found, false otherwise
334
- */
335
- public function findFile($class)
336
- {
337
- // class map lookup
338
- if (isset($this->classMap[$class])) {
339
- return $this->classMap[$class];
340
- }
341
- if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
- return false;
343
- }
344
- if (null !== $this->apcuPrefix) {
345
- $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
- if ($hit) {
347
- return $file;
348
- }
349
- }
350
-
351
- $file = $this->findFileWithExtension($class, '.php');
352
-
353
- // Search for Hack files if we are running on HHVM
354
- if (false === $file && defined('HHVM_VERSION')) {
355
- $file = $this->findFileWithExtension($class, '.hh');
356
- }
357
-
358
- if (null !== $this->apcuPrefix) {
359
- apcu_add($this->apcuPrefix.$class, $file);
360
- }
361
-
362
- if (false === $file) {
363
- // Remember that this class does not exist.
364
- $this->missingClasses[$class] = true;
365
- }
366
-
367
- return $file;
368
- }
369
-
370
- private function findFileWithExtension($class, $ext)
371
- {
372
- // PSR-4 lookup
373
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
-
375
- $first = $class[0];
376
- if (isset($this->prefixLengthsPsr4[$first])) {
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) {
384
- if (file_exists($file = $dir . $pathEnd)) {
385
- return $file;
386
- }
387
- }
388
- }
389
- }
390
- }
391
-
392
- // PSR-4 fallback dirs
393
- foreach ($this->fallbackDirsPsr4 as $dir) {
394
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
- return $file;
396
- }
397
- }
398
-
399
- // PSR-0 lookup
400
- if (false !== $pos = strrpos($class, '\\')) {
401
- // namespaced class name
402
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
- } else {
405
- // PEAR-like class name
406
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
- }
408
-
409
- if (isset($this->prefixesPsr0[$first])) {
410
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
- if (0 === strpos($class, $prefix)) {
412
- foreach ($dirs as $dir) {
413
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
- return $file;
415
- }
416
- }
417
- }
418
- }
419
- }
420
-
421
- // PSR-0 fallback dirs
422
- foreach ($this->fallbackDirsPsr0 as $dir) {
423
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
- return $file;
425
- }
426
- }
427
-
428
- // PSR-0 include paths.
429
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
- return $file;
431
- }
432
-
433
- return false;
434
- }
435
- }
436
-
437
- /**
438
- * Scope isolated include.
439
- *
440
- * Prevents access to $this/self from included files.
441
- */
442
- function includeFile($file)
443
- {
444
- include $file;
445
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/LICENSE DELETED
@@ -1,21 +0,0 @@
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_classmap.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // autoload_classmap.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_namespaces.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_psr4.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- // autoload_psr4.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- 'Vimeo\\' => array($vendorDir . '/vimeo/vimeo-api/src/Vimeo'),
10
- 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
11
- );
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_real.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
-
3
- // autoload_real.php @generated by Composer
4
-
5
- class ComposerAutoloaderInitfb499b858061dcbc3a5ecc8995cf88b8
6
- {
7
- private static $loader;
8
-
9
- public static function loadClassLoader($class)
10
- {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
- require __DIR__ . '/ClassLoader.php';
13
- }
14
- }
15
-
16
- public static function getLoader()
17
- {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInitfb499b858061dcbc3a5ecc8995cf88b8', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitfb499b858061dcbc3a5ecc8995cf88b8', '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\ComposerStaticInitfb499b858061dcbc3a5ecc8995cf88b8::getInitializer($loader));
31
- } else {
32
- $map = require __DIR__ . '/autoload_namespaces.php';
33
- foreach ($map as $namespace => $path) {
34
- $loader->set($namespace, $path);
35
- }
36
-
37
- $map = require __DIR__ . '/autoload_psr4.php';
38
- foreach ($map as $namespace => $path) {
39
- $loader->setPsr4($namespace, $path);
40
- }
41
-
42
- $classMap = require __DIR__ . '/autoload_classmap.php';
43
- if ($classMap) {
44
- $loader->addClassMap($classMap);
45
- }
46
- }
47
-
48
- $loader->register(true);
49
-
50
- return $loader;
51
- }
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_static.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
-
3
- // autoload_static.php @generated by Composer
4
-
5
- namespace Composer\Autoload;
6
-
7
- class ComposerStaticInitfb499b858061dcbc3a5ecc8995cf88b8
8
- {
9
- public static $prefixLengthsPsr4 = array (
10
- 'V' =>
11
- array (
12
- 'Vimeo\\' => 6,
13
- ),
14
- 'C' =>
15
- array (
16
- 'Composer\\Installers\\' => 20,
17
- ),
18
- );
19
-
20
- public static $prefixDirsPsr4 = array (
21
- 'Vimeo\\' =>
22
- array (
23
- 0 => __DIR__ . '/..' . '/vimeo/vimeo-api/src/Vimeo',
24
- ),
25
- 'Composer\\Installers\\' =>
26
- array (
27
- 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
28
- ),
29
- );
30
-
31
- public static function getInitializer(ClassLoader $loader)
32
- {
33
- return \Closure::bind(function () use ($loader) {
34
- $loader->prefixLengthsPsr4 = ComposerStaticInitfb499b858061dcbc3a5ecc8995cf88b8::$prefixLengthsPsr4;
35
- $loader->prefixDirsPsr4 = ComposerStaticInitfb499b858061dcbc3a5ecc8995cf88b8::$prefixDirsPsr4;
36
-
37
- }, null, ClassLoader::class);
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installed.json DELETED
@@ -1,172 +0,0 @@
1
- [
2
- {
3
- "name": "composer/installers",
4
- "version": "v1.5.0",
5
- "version_normalized": "1.5.0.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/composer/installers.git",
9
- "reference": "049797d727261bf27f2690430d935067710049c2"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2",
14
- "reference": "049797d727261bf27f2690430d935067710049c2",
15
- "shasum": ""
16
- },
17
- "require": {
18
- "composer-plugin-api": "^1.0"
19
- },
20
- "replace": {
21
- "roundcube/plugin-installer": "*",
22
- "shama/baton": "*"
23
- },
24
- "require-dev": {
25
- "composer/composer": "1.0.*@dev",
26
- "phpunit/phpunit": "^4.8.36"
27
- },
28
- "time": "2017-12-29T09:13:20+00:00",
29
- "type": "composer-plugin",
30
- "extra": {
31
- "class": "Composer\\Installers\\Plugin",
32
- "branch-alias": {
33
- "dev-master": "1.0-dev"
34
- }
35
- },
36
- "installation-source": "dist",
37
- "autoload": {
38
- "psr-4": {
39
- "Composer\\Installers\\": "src/Composer/Installers"
40
- }
41
- },
42
- "notification-url": "https://packagist.org/downloads/",
43
- "license": [
44
- "MIT"
45
- ],
46
- "authors": [
47
- {
48
- "name": "Kyle Robinson Young",
49
- "email": "kyle@dontkry.com",
50
- "homepage": "https://github.com/shama"
51
- }
52
- ],
53
- "description": "A multi-framework Composer library installer",
54
- "homepage": "https://composer.github.io/installers/",
55
- "keywords": [
56
- "Craft",
57
- "Dolibarr",
58
- "Eliasis",
59
- "Hurad",
60
- "ImageCMS",
61
- "Kanboard",
62
- "Lan Management System",
63
- "MODX Evo",
64
- "Mautic",
65
- "Maya",
66
- "OXID",
67
- "Plentymarkets",
68
- "Porto",
69
- "RadPHP",
70
- "SMF",
71
- "Thelia",
72
- "WolfCMS",
73
- "agl",
74
- "aimeos",
75
- "annotatecms",
76
- "attogram",
77
- "bitrix",
78
- "cakephp",
79
- "chef",
80
- "cockpit",
81
- "codeigniter",
82
- "concrete5",
83
- "croogo",
84
- "dokuwiki",
85
- "drupal",
86
- "eZ Platform",
87
- "elgg",
88
- "expressionengine",
89
- "fuelphp",
90
- "grav",
91
- "installer",
92
- "itop",
93
- "joomla",
94
- "kohana",
95
- "laravel",
96
- "lavalite",
97
- "lithium",
98
- "magento",
99
- "majima",
100
- "mako",
101
- "mediawiki",
102
- "modulework",
103
- "modx",
104
- "moodle",
105
- "osclass",
106
- "phpbb",
107
- "piwik",
108
- "ppi",
109
- "puppet",
110
- "pxcms",
111
- "reindex",
112
- "roundcube",
113
- "shopware",
114
- "silverstripe",
115
- "sydes",
116
- "symfony",
117
- "typo3",
118
- "wordpress",
119
- "yawik",
120
- "zend",
121
- "zikula"
122
- ]
123
- },
124
- {
125
- "name": "vimeo/vimeo-api",
126
- "version": "2.0.0",
127
- "version_normalized": "2.0.0.0",
128
- "source": {
129
- "type": "git",
130
- "url": "https://github.com/vimeo/vimeo.php.git",
131
- "reference": "9fbf705cf4885282183744c04f3fb10793768911"
132
- },
133
- "dist": {
134
- "type": "zip",
135
- "url": "https://api.github.com/repos/vimeo/vimeo.php/zipball/9fbf705cf4885282183744c04f3fb10793768911",
136
- "reference": "9fbf705cf4885282183744c04f3fb10793768911",
137
- "shasum": ""
138
- },
139
- "require": {
140
- "ext-curl": "*",
141
- "ext-json": "*",
142
- "php": ">=5.3.0"
143
- },
144
- "require-dev": {
145
- "phpunit/phpunit": "^4.8"
146
- },
147
- "time": "2018-02-06T19:06:58+00:00",
148
- "type": "library",
149
- "installation-source": "dist",
150
- "autoload": {
151
- "psr-4": {
152
- "Vimeo\\": "src/Vimeo"
153
- }
154
- },
155
- "notification-url": "https://packagist.org/downloads/",
156
- "license": [
157
- "Apache-2.0"
158
- ],
159
- "authors": [
160
- {
161
- "name": "Vimeo",
162
- "homepage": "http://vimeo.com"
163
- }
164
- ],
165
- "description": "Official PHP library for the Vimeo API.",
166
- "homepage": "https://github.com/vimeo/vimeo.php",
167
- "keywords": [
168
- "video",
169
- "vimeo"
170
- ]
171
- }
172
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/.editorconfig DELETED
@@ -1,10 +0,0 @@
1
- ; top-most EditorConfig file
2
- root = true
3
-
4
- ; Unix-style newlines
5
- [*]
6
- end_of_line = LF
7
-
8
- [*.php]
9
- indent_style = space
10
- indent_size = 4
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- vendor/
2
- composer.lock
3
- .idea/
 
 
 
vendor/composer/installers/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- language: php
2
-
3
- sudo: false
4
-
5
- dist: trusty
6
-
7
- git:
8
- depth: 5
9
-
10
- php:
11
- - 5.4
12
- - 5.5
13
- - 5.6
14
- - 7.0
15
- - 7.1
16
- - 7.2
17
- - hhvm
18
- - nightly
19
-
20
- matrix:
21
- include:
22
- - dist: precise
23
- php: 5.3
24
- fast_finish: true
25
- allow_failures:
26
- - php: nightly
27
-
28
- before_script:
29
- - composer self-update
30
- - composer install
31
-
32
- script:
33
- - composer test
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/CHANGELOG.md DELETED
@@ -1,86 +0,0 @@
1
- # Change Log
2
-
3
- ## [Unreleased]
4
-
5
- ## v1.5.0 - 2017-12-29
6
- ### Added
7
- * Added WordPress dropin support.
8
- * Added new types supported for Eliasis.
9
- * Added support for Phoenix CMS.
10
- * Added MODX installer.
11
- * Added Majima instaler.
12
- * Added SiteDirect installer.
13
- * Added support optional prefix in OctoberCMS installers.
14
- * Added PHP 7.2 support.
15
-
16
- ### Changed
17
- * Changed remove packages, see [#348](https://github.com/composer/installers/pull/348).
18
-
19
- ### Fixed
20
- * Fixed code style, removed unused imports.
21
-
22
- ## v1.4.0 - 2017-08-09
23
- ### Added
24
- * Installer for eZ Platform.
25
- * Installer for UserFrosting.
26
- * Installer for Osclass.
27
- * Installer for Lan Management System.
28
-
29
- ### Changed
30
- * Added vendor name to package path for Lavalite.
31
-
32
- ## v1.3.0 - 2017-04-24
33
- ### Added
34
- * Kanboard plugins installer.
35
- * Porto-SAP installer.
36
- * Add `core` to concrete5 installer.
37
- * Support Moodle "search" plugin type.
38
- * SyDES installer.
39
- * iTop installer.
40
- * Lavalite installer.
41
- * Module type for Eliasis.
42
- * Vgmcp installer.
43
- * OntoWiki installer.
44
- * The requirements for contributing (CONTRIBUTING.md).
45
-
46
- ## v1.2.0 - 2016-08-13
47
- ### Added
48
- * Installer for Attogram.
49
- * Installer for Cockpit.
50
- * Installer for Plentymarkets.
51
- * Installer for ReIndex.
52
- * Installer for Vanilla.
53
- * Installer for YAWIK.
54
- * Added missing environments for new Shopware (5.2) Plugin System.
55
-
56
- ## v1.1.0 - 2016-07-05
57
- ### Added
58
- * Installer for ReIndex.
59
- * Installer for RadPHP.
60
- * Installer for Decibel.
61
- * Installer for Phifty.
62
- * Installer for ExpressionEngine.
63
-
64
- ### Changed
65
- * New paths for new Bitrix CMS. Old paths is deprecated.
66
-
67
- ### Deprecated
68
- * Old paths in Bitrix CMS Installer is deprecated.
69
-
70
- ## v1.0.25 - 2016-04-13
71
- ### Removed
72
- * Revert TYPO3 installer deletion.
73
-
74
- ## v1.0.24 - 2016-04-05
75
- ### Added
76
- * Installer for ImageCMS.
77
- * Installer for Mautic.
78
- * New types in the Kirby installer: `kirby-plugin` and `kirby-field`.
79
- * New types in the Drupal installer: `custom-theme` and `custom-module`.
80
-
81
- ### Changed
82
- * Switch to PSR-4.
83
- * Update Bitrix Installer: configuration for setting custom path to directory with kernel.
84
-
85
- ### Removed
86
- * Remove TYPO3 Extension installers.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/CONTRIBUTING.md DELETED
@@ -1,24 +0,0 @@
1
- # Contributing
2
-
3
- If you would like to help, please take a look at the list of
4
- [issues](https://github.com/composer/installers/issues).
5
-
6
- ## Pull requests
7
-
8
- * [Fork and clone](https://help.github.com/articles/fork-a-repo).
9
- * Run the command `php composer.phar install` to install the dependencies.
10
- This will also install the dev dependencies. See [Composer](https://getcomposer.org/doc/03-cli.md#install).
11
- * Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
12
- * Create a branch, commit, push and send us a
13
- [pull request](https://help.github.com/articles/using-pull-requests).
14
-
15
- To ensure a consistent code base, you should make sure the code follows the
16
- coding standards [PSR-1](http://www.php-fig.org/psr/psr-1/) and
17
- [PSR-2](http://www.php-fig.org/psr/psr-2/).
18
-
19
- ### Create a new Installer
20
-
21
- * Create class extends `Composer\Installers\BaseInstaller` with your Installer.
22
- * Create unit tests as a separate class or as part of a `Composer\Installers\Test\InstallerTest`.
23
- * Add information about your Installer in `README.md` in section "Current Supported Package Types".
24
- * Run the tests.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/README.md DELETED
@@ -1,221 +0,0 @@
1
- # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
2
-
3
- [![Build Status](http://img.shields.io/travis/composer/installers.svg)](http://travis-ci.org/composer/installers)
4
-
5
- This is for PHP package authors to require in their `composer.json`. It will
6
- install their package to the correct location based on the specified package
7
- type.
8
-
9
- The goal of Installers is to be a simple package type to install path map.
10
- Users can also customize the install path per package and package authors can
11
- modify the package name upon installing.
12
-
13
- Installers isn't intended on replacing all custom installers. If your
14
- package requires special installation handling then by all means, create a
15
- custom installer to handle it.
16
-
17
- **Natively Supported Frameworks**:
18
-
19
- The following frameworks natively work with Composer and will be
20
- installed to the default `vendor` directory. `composer/installers`
21
- is not needed to install packages with these frameworks:
22
-
23
- * Aura
24
- * Symfony2
25
- * Yii
26
- * Yii2
27
-
28
- ## Current Supported Package Types
29
-
30
- > Stable types are marked as **bold**, this means that installation paths
31
- > for those type will not be changed. Any adjustment for those types would
32
- > require creation of brand new type that will cover required changes.
33
-
34
- | Framework | Types
35
- | --------- | -----
36
- | Aimeos | `aimeos-extension`
37
- | Asgard | `asgard-module`<br>`asgard-theme`
38
- | Attogram | `attogram-module`
39
- | AGL | `agl-module`
40
- | Bonefish | `bonefish-package`
41
- | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
42
- | Bitrix | `bitrix-module` (deprecated) <br>`bitrix-component` (deprecated) <br>`bitrix-theme` (deprecated) <br><br> `bitrix-d7-module` <br> `bitrix-d7-component` <br> `bitrix-d7-template`
43
- | CakePHP 2+ | **`cakephp-plugin`**
44
- | Chef | `chef-cookbook`<br>`chef-role`
45
- | CCFramework | `ccframework-ship`<br>`ccframework-theme`
46
- | Cockpit | `cockpit-module`
47
- | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
48
- | concrete5 | `concrete5-core`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-block`<br>`concrete5-update`
49
- | Craft | `craft-plugin`
50
- | Croogo | `croogo-plugin`<br>`croogo-theme`
51
- | Decibel | `decibel-app`
52
- | DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
53
- | Dolibarr | `dolibarr-module`
54
- | Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
55
- | Elgg | `elgg-plugin`
56
- | Eliasis | `eliasis-component`<br>`eliasis-module`<br>`eliasis-plugin`<br>`eliasis-template`
57
- | ExpressionEngine 3 | `ee3-addon`<br>`ee3-theme`
58
- | eZ Platform | `ezplatform-assets`<br>`ezplatform-meta-assets`
59
- | FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
60
- | FuelPHP v2.x | `fuelphp-component`
61
- | Grav | `grav-plugin`<br>`grav-theme`
62
- | Hurad | `hurad-plugin`<br>`hurad-theme`
63
- | ImageCMS | `imagecms-template`<br>`imagecms-module`<br>`imagecms-library`
64
- | iTop | `itop-extension`
65
- | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
66
- | Kanboard | `kanboard-plugin`
67
- | Kirby | **`kirby-plugin`**<br>`kirby-field`<br>`kirby-tag`
68
- | KodiCMS | `kodicms-plugin`<br>`kodicms-media`
69
- | Kohana | **`kohana-module`**
70
- | Lan Management System | `lms-plugin`<br>`lms-template`<br>`lms-document-template`<br>`lms-userpanel-module`
71
- | Laravel | `laravel-library`
72
- | Lavalite | `lavalite-theme`<br>`lavalite-package`
73
- | Lithium | **`lithium-library`<br>`lithium-source`**
74
- | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
75
- | majima | `majima-plugin`
76
- | Mako | `mako-package`
77
- | Mautic | `mautic-plugin`<br>`mautic-theme`
78
- | Maya | `maya-module`
79
- | MODX | `modx-extra`
80
- | MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
81
- | MediaWiki | `mediawiki-extension`
82
- | October | **`october-module`<br>`october-plugin`<br>`october-theme`**
83
- | OntoWiki | `ontowiki-extension`<br>`ontowiki-theme`<br>`ontowiki-translation`
84
- | OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
85
- | Osclass | `osclass-plugin`<br>`osclass-theme`<br>`osclass-language`
86
- | MODULEWork | `modulework-module`
87
- | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
88
- | Piwik | `piwik-plugin`
89
- | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
90
- | Pimcore | `pimcore-plugin`
91
- | Plentymarkets | `plentymarkets-plugin`
92
- | PPI | **`ppi-module`**
93
- | Puppet | `puppet-module`
94
- | Porto | `porto-container`
95
- | RadPHP | `radphp-bundle`
96
- | REDAXO | `redaxo-addon`
97
- | ReIndex | **`reindex-plugin`** <br> **`reindex-theme`**
98
- | Roundcube | `roundcube-plugin`
99
- | shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`<br/>`shopware-plugin`<br/>`shopware-frontend-theme`
100
- | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
101
- | SiteDirect | `sitedirect-module`<br>`sitedirect-plugin`
102
- | SMF | `smf-module`<br>`smf-theme`
103
- | SyDES | `sydes-module`<br>`sydes-theme`
104
- | symfony1 | **`symfony1-plugin`**
105
- | Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
106
- | TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
107
- | TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
108
- | UserFrosting | `userfrosting-sprinkle`
109
- | Vanilla | `vanilla-plugin`<br>`vanilla-theme`
110
- | Vgmcp | `vgmcp-bundle`<br>`vgmcp-theme`
111
- | Wolf CMS | `wolfcms-plugin`
112
- | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`<br>`wordpress-dropin`
113
- | YAWIK | `yawik-module`
114
- | Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
115
- | Zikula | `zikula-module`<br>`zikula-theme`
116
- | Prestashop | `prestashop-module`<br>`prestashop-theme`
117
- | Phifty | `phifty-bundle`<br>`phifty-framework`<br>`phifty-library`
118
-
119
- ## Example `composer.json` File
120
-
121
- This is an example for a CakePHP plugin. The only important parts to set in your
122
- composer.json file are `"type": "cakephp-plugin"` which describes what your
123
- package is and `"require": { "composer/installers": "~1.0" }` which tells composer
124
- to load the custom installers.
125
-
126
- ```json
127
- {
128
- "name": "you/ftp",
129
- "type": "cakephp-plugin",
130
- "require": {
131
- "composer/installers": "~1.0"
132
- }
133
- }
134
- ```
135
-
136
- This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
137
- when a user runs `php composer.phar install`.
138
-
139
- So submit your packages to [packagist.org](http://packagist.org)!
140
-
141
- ## Custom Install Paths
142
-
143
- If you are consuming a package that uses the `composer/installers` you can
144
- override the install path with the following extra in your `composer.json`:
145
-
146
- ```json
147
- {
148
- "extra": {
149
- "installer-paths": {
150
- "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
151
- }
152
- }
153
- }
154
- ```
155
-
156
- A package type can have a custom installation path with a `type:` prefix.
157
-
158
- ``` json
159
- {
160
- "extra": {
161
- "installer-paths": {
162
- "your/custom/path/{$name}/": ["type:wordpress-plugin"]
163
- }
164
- }
165
- }
166
- ```
167
-
168
- You can also have the same vendor packages with a custom installation path by
169
- using the `vendor:` prefix.
170
-
171
- ``` json
172
- {
173
- "extra": {
174
- "installer-paths": {
175
- "your/custom/path/{$name}/": ["vendor:my_organization"]
176
- }
177
- }
178
- }
179
- ```
180
-
181
- These would use your custom path for each of the listed packages. The available
182
- variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
183
-
184
- ## Custom Install Names
185
-
186
- If you're a package author and need your package to be named differently when
187
- installed consider using the `installer-name` extra.
188
-
189
- For example you have a package named `shama/cakephp-ftp` with the type
190
- `cakephp-plugin`. Installing with `composer/installers` would install to the
191
- path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
192
- package author actually need the package to be named and installed to
193
- `Plugin/Ftp`. Using the following config within your **package** `composer.json`
194
- will allow this:
195
-
196
- ```json
197
- {
198
- "name": "shama/cakephp-ftp",
199
- "type": "cakephp-plugin",
200
- "extra": {
201
- "installer-name": "Ftp"
202
- }
203
- }
204
- ```
205
-
206
- Please note the name entered into `installer-name` will be the final and will
207
- not be inflected.
208
-
209
- ## Should we allow dynamic package types or paths? No.
210
-
211
- What are they? The ability for a package author to determine where a package
212
- will be installed either through setting the path directly in their
213
- `composer.json` or through a dynamic package type: `"type":
214
- "framework-install-here"`.
215
-
216
- It has been proposed many times. Even implemented once early on and then
217
- removed. Installers won't do this because it would allow a single package
218
- author to wipe out entire folders without the user's consent. That user would
219
- then come here to yell at us.
220
-
221
- Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/_config.yml DELETED
@@ -1 +0,0 @@
1
- theme: jekyll-theme-cayman
 
vendor/composer/installers/composer.json DELETED
@@ -1,105 +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
- "Kohana",
35
- "Lan Management System",
36
- "Laravel",
37
- "Lavalite",
38
- "Lithium",
39
- "Magento",
40
- "majima",
41
- "Mako",
42
- "Mautic",
43
- "Maya",
44
- "MODX",
45
- "MODX Evo",
46
- "MediaWiki",
47
- "OXID",
48
- "osclass",
49
- "MODULEWork",
50
- "Moodle",
51
- "Piwik",
52
- "pxcms",
53
- "phpBB",
54
- "Plentymarkets",
55
- "PPI",
56
- "Puppet",
57
- "Porto",
58
- "RadPHP",
59
- "ReIndex",
60
- "Roundcube",
61
- "shopware",
62
- "SilverStripe",
63
- "SMF",
64
- "SyDES",
65
- "symfony",
66
- "Thelia",
67
- "TYPO3",
68
- "WolfCMS",
69
- "WordPress",
70
- "YAWIK",
71
- "Zend",
72
- "Zikula"
73
- ],
74
- "homepage": "https://composer.github.io/installers/",
75
- "authors": [
76
- {
77
- "name": "Kyle Robinson Young",
78
- "email": "kyle@dontkry.com",
79
- "homepage": "https://github.com/shama"
80
- }
81
- ],
82
- "autoload": {
83
- "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
84
- },
85
- "extra": {
86
- "class": "Composer\\Installers\\Plugin",
87
- "branch-alias": {
88
- "dev-master": "1.0-dev"
89
- }
90
- },
91
- "replace": {
92
- "shama/baton": "*",
93
- "roundcube/plugin-installer": "*"
94
- },
95
- "require": {
96
- "composer-plugin-api": "^1.0"
97
- },
98
- "require-dev": {
99
- "composer/composer": "1.0.*@dev",
100
- "phpunit/phpunit": "^4.8.36"
101
- },
102
- "scripts": {
103
- "test": "phpunit"
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/phpunit.xml.dist DELETED
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit backupGlobals="false"
4
- backupStaticAttributes="false"
5
- colors="true"
6
- convertErrorsToExceptions="true"
7
- convertNoticesToExceptions="true"
8
- convertWarningsToExceptions="true"
9
- processIsolation="false"
10
- stopOnFailure="false"
11
- syntaxCheck="false"
12
- bootstrap="tests/bootstrap.php"
13
- >
14
- <testsuites>
15
- <testsuite name="Installers Test Suite">
16
- <directory>tests/Composer/Installers</directory>
17
- </testsuite>
18
- </testsuites>
19
-
20
- <filter>
21
- <whitelist>
22
- <directory>src/Composer/Installers</directory>
23
- </whitelist>
24
- </filter>
25
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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,136 +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
- 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 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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php DELETED
@@ -1,9 +0,0 @@
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 DELETED
@@ -1,82 +0,0 @@
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 DELETED
@@ -1,11 +0,0 @@
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/ClanCatsFrameworkInstaller.php DELETED
@@ -1,10 +0,0 @@
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 DELETED
@@ -1,34 +0,0 @@
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 DELETED
@@ -1,11 +0,0 @@
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 DELETED
@@ -1,13 +0,0 @@
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 DELETED
@@ -1,35 +0,0 @@
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 DELETED
@@ -1,21 +0,0 @@
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 DELETED
@@ -1,10 +0,0 @@
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/DokuWikiInstaller.php DELETED
@@ -1,50 +0,0 @@
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 DELETED
@@ -1,16 +0,0 @@
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 DELETED
@@ -1,16 +0,0 @@
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
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php DELETED
@@ -1,9 +0,0 @@
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 DELETED
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,29 +0,0 @@
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 DELETED
@@ -1,10 +0,0 @@
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 DELETED
@@ -1,11 +0,0 @@
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 DELETED
@@ -1,9 +0,0 @@
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 DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class GravInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'user/plugins/{$name}/',
8
- 'theme' => 'user/themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name
13
- *
14
- * @param array $vars
15
- *
16
- * @return array
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $restrictedWords = implode('|', array_keys($this->locations));
21
-
22
- $vars['name'] = strtolower($vars['name']);
23
- $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
24
- '$1',
25
- $vars['name']
26
- );
27
-
28
- return $vars;
29
- }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/HuradInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class HuradInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'plugins/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- $nameParts = explode('/', $vars['name']);
17
- foreach ($nameParts as &$value) {
18
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
19
- $value = str_replace(array('-', '_'), ' ', $value);
20
- $value = str_replace(' ', '', ucwords($value));
21
- }
22
- $vars['name'] = implode('/', $nameParts);
23
- return $vars;
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ImageCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'template' => 'templates/{$name}/',
8
- 'module' => 'application/modules/{$name}/',
9
- 'library' => 'application/libraries/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/Installer.php DELETED
@@ -1,200 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\IO\IOInterface;
5
- use Composer\Installer\LibraryInstaller;
6
- use Composer\Package\PackageInterface;
7
- use Composer\Repository\InstalledRepositoryInterface;
8
-
9
- class Installer extends LibraryInstaller
10
- {
11
- /**
12
- * Package types to installer class map
13
- *
14
- * @var array
15
- */
16
- private $supportedTypes = array(
17
- 'aimeos' => 'AimeosInstaller',
18
- 'asgard' => 'AsgardInstaller',
19
- 'attogram' => 'AttogramInstaller',
20
- 'agl' => 'AglInstaller',
21
- 'annotatecms' => 'AnnotateCmsInstaller',
22
- 'bitrix' => 'BitrixInstaller',
23
- 'bonefish' => 'BonefishInstaller',
24
- 'cakephp' => 'CakePHPInstaller',
25
- 'chef' => 'ChefInstaller',
26
- 'ccframework' => 'ClanCatsFrameworkInstaller',
27
- 'cockpit' => 'CockpitInstaller',
28
- 'codeigniter' => 'CodeIgniterInstaller',
29
- 'concrete5' => 'Concrete5Installer',
30
- 'craft' => 'CraftInstaller',
31
- 'croogo' => 'CroogoInstaller',
32
- 'dokuwiki' => 'DokuWikiInstaller',
33
- 'dolibarr' => 'DolibarrInstaller',
34
- 'decibel' => 'DecibelInstaller',
35
- 'drupal' => 'DrupalInstaller',
36
- 'elgg' => 'ElggInstaller',
37
- 'eliasis' => 'EliasisInstaller',
38
- 'ee3' => 'ExpressionEngineInstaller',
39
- 'ee2' => 'ExpressionEngineInstaller',
40
- 'ezplatform' => 'EzPlatformInstaller',
41
- 'fuel' => 'FuelInstaller',
42
- 'fuelphp' => 'FuelphpInstaller',
43
- 'grav' => 'GravInstaller',
44
- 'hurad' => 'HuradInstaller',
45
- 'imagecms' => 'ImageCMSInstaller',
46
- 'itop' => 'ItopInstaller',
47
- 'joomla' => 'JoomlaInstaller',
48
- 'kanboard' => 'KanboardInstaller',
49
- 'kirby' => 'KirbyInstaller',
50
- 'kodicms' => 'KodiCMSInstaller',
51
- 'kohana' => 'KohanaInstaller',
52
- 'lms' => 'LanManagementSystemInstaller',
53
- 'laravel' => 'LaravelInstaller',
54
- 'lavalite' => 'LavaLiteInstaller',
55
- 'lithium' => 'LithiumInstaller',
56
- 'magento' => 'MagentoInstaller',
57
- 'majima' => 'MajimaInstaller',
58
- 'mako' => 'MakoInstaller',
59
- 'maya' => 'MayaInstaller',
60
- 'mautic' => 'MauticInstaller',
61
- 'mediawiki' => 'MediaWikiInstaller',
62
- 'microweber' => 'MicroweberInstaller',
63
- 'modulework' => 'MODULEWorkInstaller',
64
- 'modx' => 'ModxInstaller',
65
- 'modxevo' => 'MODXEvoInstaller',
66
- 'moodle' => 'MoodleInstaller',
67
- 'october' => 'OctoberInstaller',
68
- 'ontowiki' => 'OntoWikiInstaller',
69
- 'oxid' => 'OxidInstaller',
70
- 'osclass' => 'OsclassInstaller',
71
- 'pxcms' => 'PxcmsInstaller',
72
- 'phpbb' => 'PhpBBInstaller',
73
- 'pimcore' => 'PimcoreInstaller',
74
- 'piwik' => 'PiwikInstaller',
75
- 'plentymarkets'=> 'PlentymarketsInstaller',
76
- 'ppi' => 'PPIInstaller',
77
- 'puppet' => 'PuppetInstaller',
78
- 'radphp' => 'RadPHPInstaller',
79
- 'phifty' => 'PhiftyInstaller',
80
- 'porto' => 'PortoInstaller',
81
- 'redaxo' => 'RedaxoInstaller',
82
- 'reindex' => 'ReIndexInstaller',
83
- 'roundcube' => 'RoundcubeInstaller',
84
- 'shopware' => 'ShopwareInstaller',
85
- 'sitedirect' => 'SiteDirectInstaller',
86
- 'silverstripe' => 'SilverStripeInstaller',
87
- 'smf' => 'SMFInstaller',
88
- 'sydes' => 'SyDESInstaller',
89
- 'symfony1' => 'Symfony1Installer',
90
- 'thelia' => 'TheliaInstaller',
91
- 'tusk' => 'TuskInstaller',
92
- 'typo3-cms' => 'TYPO3CmsInstaller',
93
- 'typo3-flow' => 'TYPO3FlowInstaller',
94
- 'userfrosting' => 'UserFrostingInstaller',
95
- 'vanilla' => 'VanillaInstaller',
96
- 'whmcs' => 'WHMCSInstaller',
97
- 'wolfcms' => 'WolfCMSInstaller',
98
- 'wordpress' => 'WordPressInstaller',
99
- 'yawik' => 'YawikInstaller',
100
- 'zend' => 'ZendInstaller',
101
- 'zikula' => 'ZikulaInstaller',
102
- 'prestashop' => 'PrestashopInstaller'
103
- );
104
-
105
- /**
106
- * {@inheritDoc}
107
- */
108
- public function getInstallPath(PackageInterface $package)
109
- {
110
- $type = $package->getType();
111
- $frameworkType = $this->findFrameworkType($type);
112
-
113
- if ($frameworkType === false) {
114
- throw new \InvalidArgumentException(
115
- 'Sorry the package type of this package is not yet supported.'
116
- );
117
- }
118
-
119
- $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
120
- $installer = new $class($package, $this->composer, $this->getIO());
121
-
122
- return $installer->getInstallPath($package, $frameworkType);
123
- }
124
-
125
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
126
- {
127
- parent::uninstall($repo, $package);
128
- $installPath = $this->getPackageBasePath($package);
129
- $this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
130
- }
131
-
132
- /**
133
- * {@inheritDoc}
134
- */
135
- public function supports($packageType)
136
- {
137
- $frameworkType = $this->findFrameworkType($packageType);
138
-
139
- if ($frameworkType === false) {
140
- return false;
141
- }
142
-
143
- $locationPattern = $this->getLocationPattern($frameworkType);
144
-
145
- return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
146
- }
147
-
148
- /**
149
- * Finds a supported framework type if it exists and returns it
150
- *
151
- * @param string $type
152
- * @return string
153
- */
154
- protected function findFrameworkType($type)
155
- {
156
- $frameworkType = false;
157
-
158
- krsort($this->supportedTypes);
159
-
160
- foreach ($this->supportedTypes as $key => $val) {
161
- if ($key === substr($type, 0, strlen($key))) {
162
- $frameworkType = substr($type, 0, strlen($key));
163
- break;
164
- }
165
- }
166
-
167
- return $frameworkType;
168
- }
169
-
170
- /**
171
- * Get the second part of the regular expression to check for support of a
172
- * package type
173
- *
174
- * @param string $frameworkType
175
- * @return string
176
- */
177
- protected function getLocationPattern($frameworkType)
178
- {
179
- $pattern = false;
180
- if (!empty($this->supportedTypes[$frameworkType])) {
181
- $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
182
- /** @var BaseInstaller $framework */
183
- $framework = new $frameworkClass(null, $this->composer, $this->getIO());
184
- $locations = array_keys($framework->getLocations());
185
- $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
186
- }
187
-
188
- return $pattern ? : '(\w+)';
189
- }
190
-
191
- /**
192
- * Get I/O object
193
- *
194
- * @return IOInterface
195
- */
196
- private function getIO()
197
- {
198
- return $this->io;
199
- }
200
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ItopInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ItopInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'extensions/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class JoomlaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'component' => 'components/{$name}/',
8
- 'module' => 'modules/{$name}/',
9
- 'template' => 'templates/{$name}/',
10
- 'plugin' => 'plugins/{$name}/',
11
- 'library' => 'libraries/{$name}/',
12
- );
13
-
14
- // TODO: Add inflector for mod_ and com_ names
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- *
6
- * Installer for kanboard plugins
7
- *
8
- * kanboard.net
9
- *
10
- * Class KanboardInstaller
11
- * @package Composer\Installers
12
- */
13
- class KanboardInstaller extends BaseInstaller
14
- {
15
- protected $locations = array(
16
- 'plugin' => 'plugins/{$name}/',
17
- );
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KirbyInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'site/plugins/{$name}/',
8
- 'field' => 'site/fields/{$name}/',
9
- 'tag' => 'site/tags/{$name}/'
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KodiCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'cms/plugins/{$name}/',
8
- 'media' => 'cms/media/vendor/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KohanaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class LanManagementSystemInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'plugin' => 'plugins/{$name}/',
10
- 'template' => 'templates/{$name}/',
11
- 'document-template' => 'documents/templates/{$name}/',
12
- 'userpanel-module' => 'userpanel/modules/{$name}/',
13
- );
14
-
15
- /**
16
- * Format package name to CamelCase
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
21
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
22
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
23
-
24
- return $vars;
25
- }
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LaravelInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'libraries/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LavaLiteInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'package' => 'packages/{$vendor}/{$name}/',
8
- 'theme' => 'public/themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LithiumInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'libraries/{$name}/',
8
- 'source' => 'libraries/_source/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MODULEWorkInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle MODX Evolution specifics when installing packages.
6
- */
7
- class MODXEvoInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'snippet' => 'assets/snippets/{$name}/',
11
- 'plugin' => 'assets/plugins/{$name}/',
12
- 'module' => 'assets/modules/{$name}/',
13
- 'template' => 'assets/templates/{$name}/',
14
- 'lib' => 'assets/lib/{$name}/'
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MagentoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'theme' => 'app/design/frontend/{$name}/',
8
- 'skin' => 'skin/frontend/default/{$name}/',
9
- 'library' => 'lib/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin/theme installer for majima
6
- * @author David Neustadt
7
- */
8
- class MajimaInstaller extends BaseInstaller
9
- {
10
- protected $locations = array(
11
- 'plugin' => 'plugins/{$name}/',
12
- );
13
-
14
- /**
15
- * Transforms the names
16
- * @param array $vars
17
- * @return array
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- return $this->correctPluginName($vars);
22
- }
23
-
24
- /**
25
- * Change hyphenated names to camelcase
26
- * @param array $vars
27
- * @return array
28
- */
29
- private function correctPluginName($vars)
30
- {
31
- $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
32
- return strtoupper($matches[0][1]);
33
- }, $vars['name']);
34
- $vars['name'] = ucfirst($camelCasedName);
35
- return $vars;
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MakoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'package' => 'app/packages/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MauticInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MauticInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name of mautic-plugins to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- if ($vars['type'] == 'mautic-plugin') {
17
- $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
18
- return strtoupper($matches[0][1]);
19
- }, ucfirst($vars['name']));
20
- }
21
-
22
- return $vars;
23
- }
24
-
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MayaInstaller.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MayaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name.
12
- *
13
- * For package type maya-module, cut off a trailing '-module' if present.
14
- *
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- if ($vars['type'] === 'maya-module') {
19
- return $this->inflectModuleVars($vars);
20
- }
21
-
22
- return $vars;
23
- }
24
-
25
- protected function inflectModuleVars($vars)
26
- {
27
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
28
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
29
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
30
-
31
- return $vars;
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MediaWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'extensions/{$name}/',
8
- 'skin' => 'skins/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
15
- * to CamelCase keeping existing uppercase chars.
16
- *
17
- * For package type mediawiki-skin, cut off a trailing '-skin' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
-
23
- if ($vars['type'] === 'mediawiki-extension') {
24
- return $this->inflectExtensionVars($vars);
25
- }
26
-
27
- if ($vars['type'] === 'mediawiki-skin') {
28
- return $this->inflectSkinVars($vars);
29
- }
30
-
31
- return $vars;
32
- }
33
-
34
- protected function inflectExtensionVars($vars)
35
- {
36
- $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
37
- $vars['name'] = str_replace('-', ' ', $vars['name']);
38
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
39
-
40
- return $vars;
41
- }
42
-
43
- protected function inflectSkinVars($vars)
44
- {
45
- $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
46
-
47
- return $vars;
48
- }
49
-
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MicroweberInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'userfiles/modules/{$name}/',
8
- 'module-skin' => 'userfiles/modules/{$name}/templates/',
9
- 'template' => 'userfiles/templates/{$name}/',
10
- 'element' => 'userfiles/elements/{$name}/',
11
- 'vendor' => 'vendor/{$name}/',
12
- 'components' => 'components/{$name}/'
13
- );
14
-
15
- /**
16
- * Format package name.
17
- *
18
- * For package type microweber-module, cut off a trailing '-module' if present
19
- *
20
- * For package type microweber-template, cut off a trailing '-template' if present.
21
- *
22
- */
23
- public function inflectPackageVars($vars)
24
- {
25
- if ($vars['type'] === 'microweber-template') {
26
- return $this->inflectTemplateVars($vars);
27
- }
28
- if ($vars['type'] === 'microweber-templates') {
29
- return $this->inflectTemplatesVars($vars);
30
- }
31
- if ($vars['type'] === 'microweber-core') {
32
- return $this->inflectCoreVars($vars);
33
- }
34
- if ($vars['type'] === 'microweber-adapter') {
35
- return $this->inflectCoreVars($vars);
36
- }
37
- if ($vars['type'] === 'microweber-module') {
38
- return $this->inflectModuleVars($vars);
39
- }
40
- if ($vars['type'] === 'microweber-modules') {
41
- return $this->inflectModulesVars($vars);
42
- }
43
- if ($vars['type'] === 'microweber-skin') {
44
- return $this->inflectSkinVars($vars);
45
- }
46
- if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
47
- return $this->inflectElementVars($vars);
48
- }
49
-
50
- return $vars;
51
- }
52
-
53
- protected function inflectTemplateVars($vars)
54
- {
55
- $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
56
- $vars['name'] = preg_replace('/template-$/', '', $vars['name']);
57
-
58
- return $vars;
59
- }
60
-
61
- protected function inflectTemplatesVars($vars)
62
- {
63
- $vars['name'] = preg_replace('/-templates$/', '', $vars['name']);
64
- $vars['name'] = preg_replace('/templates-$/', '', $vars['name']);
65
-
66
- return $vars;
67
- }
68
-
69
- protected function inflectCoreVars($vars)
70
- {
71
- $vars['name'] = preg_replace('/-providers$/', '', $vars['name']);
72
- $vars['name'] = preg_replace('/-provider$/', '', $vars['name']);
73
- $vars['name'] = preg_replace('/-adapter$/', '', $vars['name']);
74
-
75
- return $vars;
76
- }
77
-
78
- protected function inflectModuleVars($vars)
79
- {
80
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
81
- $vars['name'] = preg_replace('/module-$/', '', $vars['name']);
82
-
83
- return $vars;
84
- }
85
-
86
- protected function inflectModulesVars($vars)
87
- {
88
- $vars['name'] = preg_replace('/-modules$/', '', $vars['name']);
89
- $vars['name'] = preg_replace('/modules-$/', '', $vars['name']);
90
-
91
- return $vars;
92
- }
93
-
94
- protected function inflectSkinVars($vars)
95
- {
96
- $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
97
- $vars['name'] = preg_replace('/skin-$/', '', $vars['name']);
98
-
99
- return $vars;
100
- }
101
-
102
- protected function inflectElementVars($vars)
103
- {
104
- $vars['name'] = preg_replace('/-elements$/', '', $vars['name']);
105
- $vars['name'] = preg_replace('/elements-$/', '', $vars['name']);
106
- $vars['name'] = preg_replace('/-element$/', '', $vars['name']);
107
- $vars['name'] = preg_replace('/element-$/', '', $vars['name']);
108
-
109
- return $vars;
110
- }
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ModxInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle MODX specifics when installing packages.
6
- */
7
- class ModxInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'extra' => 'core/packages/{$name}/'
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MoodleInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'mod' => 'mod/{$name}/',
8
- 'admin_report' => 'admin/report/{$name}/',
9
- 'atto' => 'lib/editor/atto/plugins/{$name}/',
10
- 'tool' => 'admin/tool/{$name}/',
11
- 'assignment' => 'mod/assignment/type/{$name}/',
12
- 'assignsubmission' => 'mod/assign/submission/{$name}/',
13
- 'assignfeedback' => 'mod/assign/feedback/{$name}/',
14
- 'auth' => 'auth/{$name}/',
15
- 'availability' => 'availability/condition/{$name}/',
16
- 'block' => 'blocks/{$name}/',
17
- 'booktool' => 'mod/book/tool/{$name}/',
18
- 'cachestore' => 'cache/stores/{$name}/',
19
- 'cachelock' => 'cache/locks/{$name}/',
20
- 'calendartype' => 'calendar/type/{$name}/',
21
- 'format' => 'course/format/{$name}/',
22
- 'coursereport' => 'course/report/{$name}/',
23
- 'datafield' => 'mod/data/field/{$name}/',
24
- 'datapreset' => 'mod/data/preset/{$name}/',
25
- 'editor' => 'lib/editor/{$name}/',
26
- 'enrol' => 'enrol/{$name}/',
27
- 'filter' => 'filter/{$name}/',
28
- 'gradeexport' => 'grade/export/{$name}/',
29
- 'gradeimport' => 'grade/import/{$name}/',
30
- 'gradereport' => 'grade/report/{$name}/',
31
- 'gradingform' => 'grade/grading/form/{$name}/',
32
- 'local' => 'local/{$name}/',
33
- 'logstore' => 'admin/tool/log/store/{$name}/',
34
- 'ltisource' => 'mod/lti/source/{$name}/',
35
- 'ltiservice' => 'mod/lti/service/{$name}/',
36
- 'message' => 'message/output/{$name}/',
37
- 'mnetservice' => 'mnet/service/{$name}/',
38
- 'plagiarism' => 'plagiarism/{$name}/',
39
- 'portfolio' => 'portfolio/{$name}/',
40
- 'qbehaviour' => 'question/behaviour/{$name}/',
41
- 'qformat' => 'question/format/{$name}/',
42
- 'qtype' => 'question/type/{$name}/',
43
- 'quizaccess' => 'mod/quiz/accessrule/{$name}/',
44
- 'quiz' => 'mod/quiz/report/{$name}/',
45
- 'report' => 'report/{$name}/',
46
- 'repository' => 'repository/{$name}/',
47
- 'scormreport' => 'mod/scorm/report/{$name}/',
48
- 'search' => 'search/engine/{$name}/',
49
- 'theme' => 'theme/{$name}/',
50
- 'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
51
- 'profilefield' => 'user/profile/field/{$name}/',
52
- 'webservice' => 'webservice/{$name}/',
53
- 'workshopallocation' => 'mod/workshop/allocation/{$name}/',
54
- 'workshopeval' => 'mod/workshop/eval/{$name}/',
55
- 'workshopform' => 'mod/workshop/form/{$name}/'
56
- );
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class OctoberInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'plugin' => 'plugins/{$vendor}/{$name}/',
9
- 'theme' => 'themes/{$name}/'
10
- );
11
-
12
- /**
13
- * Format package name.
14
- *
15
- * For package type october-plugin, cut off a trailing '-plugin' if present.
16
- *
17
- * For package type october-theme, cut off a trailing '-theme' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
- if ($vars['type'] === 'october-plugin') {
23
- return $this->inflectPluginVars($vars);
24
- }
25
-
26
- if ($vars['type'] === 'october-theme') {
27
- return $this->inflectThemeVars($vars);
28
- }
29
-
30
- return $vars;
31
- }
32
-
33
- protected function inflectPluginVars($vars)
34
- {
35
- $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
36
-
37
- return $vars;
38
- }
39
-
40
- protected function inflectThemeVars($vars)
41
- {
42
- $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
43
-
44
- return $vars;
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class OntoWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'extensions/{$name}/',
8
- 'theme' => 'extensions/themes/{$name}/',
9
- 'translation' => 'extensions/translations/{$name}/',
10
- );
11
-
12
- /**
13
- * Format package name to lower case and remove ".ontowiki" suffix
14
- */
15
- public function inflectPackageVars($vars)
16
- {
17
- $vars['name'] = strtolower($vars['name']);
18
- $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
19
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
20
- $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);
21
-
22
- return $vars;
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
-
5
- class OsclassInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'plugin' => 'oc-content/plugins/{$name}/',
10
- 'theme' => 'oc-content/themes/{$name}/',
11
- 'language' => 'oc-content/languages/{$name}/',
12
- );
13
-
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Package\PackageInterface;
5
-
6
- class OxidInstaller extends BaseInstaller
7
- {
8
- const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
9
-
10
- protected $locations = array(
11
- 'module' => 'modules/{$name}/',
12
- 'theme' => 'application/views/{$name}/',
13
- 'out' => 'out/{$name}/',
14
- );
15
-
16
- /**
17
- * getInstallPath
18
- *
19
- * @param PackageInterface $package
20
- * @param string $frameworkType
21
- * @return void
22
- */
23
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
- {
25
- $installPath = parent::getInstallPath($package, $frameworkType);
26
- $type = $this->package->getType();
27
- if ($type === 'oxid-module') {
28
- $this->prepareVendorDirectory($installPath);
29
- }
30
- return $installPath;
31
- }
32
-
33
- /**
34
- * prepareVendorDirectory
35
- *
36
- * Makes sure there is a vendormetadata.php file inside
37
- * the vendor folder if there is a vendor folder.
38
- *
39
- * @param string $installPath
40
- * @return void
41
- */
42
- protected function prepareVendorDirectory($installPath)
43
- {
44
- $matches = '';
45
- $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
46
- if (!$hasVendorDirectory) {
47
- return;
48
- }
49
-
50
- $vendorDirectory = $matches['vendor'];
51
- $vendorPath = getcwd() . '/modules/' . $vendorDirectory;
52
- if (!file_exists($vendorPath)) {
53
- mkdir($vendorPath, 0755, true);
54
- }
55
-
56
- $vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
57
- touch($vendorMetaDataPath);
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PPIInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PhiftyInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'bundle' => 'bundles/{$name}/',
8
- 'library' => 'libraries/{$name}/',
9
- 'framework' => 'frameworks/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PhpBBInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'ext/{$vendor}/{$name}/',
8
- 'language' => 'language/{$name}/',
9
- 'style' => 'styles/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PimcoreInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
16
- $vars['name'] = 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/PiwikInstaller.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Class PiwikInstaller
6
- *
7
- * @package Composer\Installers
8
- */
9
- class PiwikInstaller extends BaseInstaller
10
- {
11
- /**
12
- * @var array
13
- */
14
- protected $locations = array(
15
- 'plugin' => 'plugins/{$name}/',
16
- );
17
-
18
- /**
19
- * Format package name to CamelCase
20
- * @param array $vars
21
- *
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
-
30
- return $vars;
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PlentymarketsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => '{$name}/'
8
- );
9
-
10
- /**
11
- * Remove hyphen, "plugin" and format to camelcase
12
- * @param array $vars
13
- *
14
- * @return array
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- $vars['name'] = explode("-", $vars['name']);
19
- foreach ($vars['name'] as $key => $name) {
20
- $vars['name'][$key] = ucfirst($vars['name'][$key]);
21
- if (strcasecmp($name, "Plugin") == 0) {
22
- unset($vars['name'][$key]);
23
- }
24
- }
25
- $vars['name'] = implode("",$vars['name']);
26
-
27
- return $vars;
28
- }
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/Plugin.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- use Composer\Composer;
6
- use Composer\IO\IOInterface;
7
- use Composer\Plugin\PluginInterface;
8
-
9
- class Plugin implements PluginInterface
10
- {
11
-
12
- public function activate(Composer $composer, IOInterface $io)
13
- {
14
- $installer = new Installer($io, $composer);
15
- $composer->getInstallationManager()->addInstaller($installer);
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PortoInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PortoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'container' => 'app/Containers/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PrestashopInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class PuppetInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'module' => 'modules/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PxcmsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'app/Modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * @param array $vars
15
- *
16
- * @return array
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- if ($vars['type'] === 'pxcms-module') {
21
- return $this->inflectModuleVars($vars);
22
- }
23
-
24
- if ($vars['type'] === 'pxcms-theme') {
25
- return $this->inflectThemeVars($vars);
26
- }
27
-
28
- return $vars;
29
- }
30
-
31
- /**
32
- * For package type pxcms-module, cut off a trailing '-plugin' if present.
33
- *
34
- * return string
35
- */
36
- protected function inflectModuleVars($vars)
37
- {
38
- $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
39
- $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
40
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
41
- $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
42
- $vars['name'] = ucwords($vars['name']); // make module name camelcased
43
-
44
- return $vars;
45
- }
46
-
47
-
48
- /**
49
- * For package type pxcms-module, cut off a trailing '-plugin' if present.
50
- *
51
- * return string
52
- */
53
- protected function inflectThemeVars($vars)
54
- {
55
- $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
56
- $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
57
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
58
- $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
59
- $vars['name'] = ucwords($vars['name']); // make module name camelcased
60
-
61
- return $vars;
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RadPHPInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'bundle' => 'src/{$name}/'
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $nameParts = explode('/', $vars['name']);
16
- foreach ($nameParts as &$value) {
17
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
18
- $value = str_replace(array('-', '_'), ' ', $value);
19
- $value = str_replace(' ', '', ucwords($value));
20
- }
21
- $vars['name'] = implode('/', $nameParts);
22
- return $vars;
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ReIndexInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'theme' => 'themes/{$name}/',
8
- 'plugin' => 'plugins/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RedaxoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'addon' => 'redaxo/include/addons/{$name}/',
8
- 'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RoundcubeInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- );
9
-
10
- /**
11
- * Lowercase name and changes the name to a underscores
12
- *
13
- * @param array $vars
14
- * @return array
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- $vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
19
-
20
- return $vars;
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/SMFInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class SMFInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'Sources/{$name}/',
8
- 'theme' => 'Themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin/theme installer for shopware
6
- * @author Benjamin Boit
7
- */
8
- class ShopwareInstaller extends BaseInstaller
9
- {
10
- protected $locations = array(
11
- 'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
12
- 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
13
- 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
14
- 'theme' => 'templates/{$name}/',
15
- 'plugin' => 'custom/plugins/{$name}/',
16
- 'frontend-theme' => 'themes/Frontend/{$name}/',
17
- );
18
-
19
- /**
20
- * Transforms the names
21
- * @param array $vars
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- if ($vars['type'] === 'shopware-theme') {
27
- return $this->correctThemeName($vars);
28
- }
29
-
30
- return $this->correctPluginName($vars);
31
- }
32
-
33
- /**
34
- * Changes the name to a camelcased combination of vendor and name
35
- * @param array $vars
36
- * @return array
37
- */
38
- private function correctPluginName($vars)
39
- {
40
- $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
41
- return strtoupper($matches[0][1]);
42
- }, $vars['name']);
43
-
44
- $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
45
-
46
- return $vars;
47
- }
48
-
49
- /**
50
- * Changes the name to a underscore separated name
51
- * @param array $vars
52
- * @return array
53
- */
54
- private function correctThemeName($vars)
55
- {
56
- $vars['name'] = str_replace('-', '_', $vars['name']);
57
-
58
- return $vars;
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Package\PackageInterface;
5
-
6
- class SilverStripeInstaller extends BaseInstaller
7
- {
8
- protected $locations = array(
9
- 'module' => '{$name}/',
10
- 'theme' => 'themes/{$name}/',
11
- );
12
-
13
- /**
14
- * Return the install path based on package type.
15
- *
16
- * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
17
- * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
18
- *
19
- * @param PackageInterface $package
20
- * @param string $frameworkType
21
- * @return string
22
- */
23
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
- {
25
- if (
26
- $package->getName() == 'silverstripe/framework'
27
- && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
28
- && version_compare($package->getVersion(), '2.999.999') < 0
29
- ) {
30
- return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
31
- }
32
-
33
- return parent::getInstallPath($package, $frameworkType);
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class SiteDirectInstaller extends BaseInstaller
6
- {
7
- protected $locations = array(
8
- 'module' => 'modules/{$vendor}/{$name}/',
9
- 'plugin' => 'plugins/{$vendor}/{$name}/'
10
- );
11
-
12
- public function inflectPackageVars($vars)
13
- {
14
- return $this->parseVars($vars);
15
- }
16
-
17
- protected function parseVars($vars)
18
- {
19
- $vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
20
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
21
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
22
-
23
- return $vars;
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class SyDESInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'app/modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format module name.
13
- *
14
- * Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
15
- *
16
- * @param array @vars
17
- *
18
- * @return array
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
- if ($vars['type'] == 'sydes-module') {
23
- return $this->inflectModuleVars($vars);
24
- }
25
-
26
- if ($vars['type'] === 'sydes-theme') {
27
- return $this->inflectThemeVars($vars);
28
- }
29
-
30
- return $vars;
31
- }
32
-
33
- public function inflectModuleVars($vars)
34
- {
35
- $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
36
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
37
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
38
-
39
- return $vars;
40
- }
41
-
42
- protected function inflectThemeVars($vars)
43
- {
44
- $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
45
- $vars['name'] = strtolower($vars['name']);
46
-
47
- return $vars;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin installer for symfony 1.x
6
- *
7
- * @author Jérôme Tamarelle <jerome@tamarelle.net>
8
- */
9
- class Symfony1Installer extends BaseInstaller
10
- {
11
- protected $locations = array(
12
- 'plugin' => 'plugins/{$name}/',
13
- );
14
-
15
- /**
16
- * Format package name to CamelCase
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
21
- return strtoupper($matches[0][1]);
22
- }, $vars['name']);
23
-
24
- return $vars;
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Extension installer for TYPO3 CMS
6
- *
7
- * @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
8
- *
9
- * @author Sascha Egerer <sascha.egerer@dkd.de>
10
- */
11
- class TYPO3CmsInstaller extends BaseInstaller
12
- {
13
- protected $locations = array(
14
- 'extension' => 'typo3conf/ext/{$name}/',
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle TYPO3 Flow specifics when installing packages.
6
- */
7
- class TYPO3FlowInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'package' => 'Packages/Application/{$name}/',
11
- 'framework' => 'Packages/Framework/{$name}/',
12
- 'plugin' => 'Packages/Plugins/{$name}/',
13
- 'site' => 'Packages/Sites/{$name}/',
14
- 'boilerplate' => 'Packages/Boilerplates/{$name}/',
15
- 'build' => 'Build/{$name}/',
16
- );
17
-
18
- /**
19
- * Modify the package name to be a TYPO3 Flow style key.
20
- *
21
- * @param array $vars
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $autoload = $this->package->getAutoload();
27
- if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
28
- $namespace = key($autoload['psr-0']);
29
- $vars['name'] = str_replace('\\', '.', $namespace);
30
- }
31
- if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
32
- $namespace = key($autoload['psr-4']);
33
- $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
34
- }
35
-
36
- return $vars;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class TheliaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'local/modules/{$name}/',
8
- 'frontoffice-template' => 'templates/frontOffice/{$name}/',
9
- 'backoffice-template' => 'templates/backOffice/{$name}/',
10
- 'email-template' => 'templates/email/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/TuskInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
- /**
4
- * Composer installer for 3rd party Tusk utilities
5
- * @author Drew Ewing <drew@phenocode.com>
6
- */
7
- class TuskInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'task' => '.tusk/tasks/{$name}/',
11
- 'command' => '.tusk/commands/{$name}/',
12
- 'asset' => 'assets/tusk/{$name}/',
13
- );
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class UserFrostingInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'sprinkle' => 'app/sprinkles/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class VanillaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class VgmcpInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'bundle' => 'src/{$vendor}/{$name}/',
8
- 'theme' => 'themes/{$name}/'
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
15
- *
16
- * For package type vgmcp-theme, cut off a trailing '-theme' if present.
17
- *
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- if ($vars['type'] === 'vgmcp-bundle') {
22
- return $this->inflectPluginVars($vars);
23
- }
24
-
25
- if ($vars['type'] === 'vgmcp-theme') {
26
- return $this->inflectThemeVars($vars);
27
- }
28
-
29
- return $vars;
30
- }
31
-
32
- protected function inflectPluginVars($vars)
33
- {
34
- $vars['name'] = preg_replace('/-bundle$/', '', $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/WHMCSInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class WHMCSInstaller extends BaseInstaller
6
- {
7
- protected $locations = array(
8
- 'gateway' => 'modules/gateways/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class WolfCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'wolf/plugins/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class WordPressInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'wp-content/plugins/{$name}/',
8
- 'theme' => 'wp-content/themes/{$name}/',
9
- 'muplugin' => 'wp-content/mu-plugins/{$name}/',
10
- 'dropin' => 'wp-content/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/YawikInstaller.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: cbleek
5
- * Date: 25.03.16
6
- * Time: 20:55
7
- */
8
-
9
- namespace Composer\Installers;
10
-
11
-
12
- class YawikInstaller extends BaseInstaller
13
- {
14
- protected $locations = array(
15
- 'module' => 'module/{$name}/',
16
- );
17
-
18
- /**
19
- * Format package name to CamelCase
20
- * @param array $vars
21
- *
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
-
30
- return $vars;
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ZendInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ZendInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'library/{$name}/',
8
- 'extra' => 'extras/library/{$name}/',
9
- 'module' => 'module/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ZikulaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$vendor}-{$name}/',
8
- 'theme' => 'themes/{$vendor}-{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/bootstrap.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- function includeIfExists($file)
3
- {
4
- if (file_exists($file)) {
5
- return include $file;
6
- }
7
- }
8
- if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
9
- die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
10
- 'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
11
- 'php composer.phar install'.PHP_EOL);
12
- }
13
- return $loader;
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\AsgardInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase;
8
-
9
- class AsgardInstallerTest extends TestCase
10
- {
11
- /**
12
- * @var AsgardInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new AsgardInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // Should keep module name StudlyCase
39
- array(
40
- 'asgard-module',
41
- 'user-profile',
42
- 'UserProfile'
43
- ),
44
- array(
45
- 'asgard-module',
46
- 'asgard-module',
47
- 'Asgard'
48
- ),
49
- array(
50
- 'asgard-module',
51
- 'blog',
52
- 'Blog'
53
- ),
54
- // tests that exactly one '-module' is cut off
55
- array(
56
- 'asgard-module',
57
- 'some-module-module',
58
- 'SomeModule',
59
- ),
60
- // tests that exactly one '-theme' is cut off
61
- array(
62
- 'asgard-theme',
63
- 'some-theme-theme',
64
- 'SomeTheme',
65
- ),
66
- // tests that names without '-theme' suffix stay valid
67
- array(
68
- 'asgard-theme',
69
- 'someothertheme',
70
- 'Someothertheme',
71
- ),
72
- // Should keep theme name StudlyCase
73
- array(
74
- 'asgard-theme',
75
- 'adminlte-advanced',
76
- 'AdminlteAdvanced'
77
- ),
78
- );
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers\Test;
4
-
5
- use Composer\Installers\BitrixInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Composer;
8
-
9
- /**
10
- * Tests for the BitrixInstaller Class
11
- *
12
- * @coversDefaultClass Composer\Installers\BitrixInstaller
13
- */
14
- class BitrixInstallerTest extends TestCase
15
- {
16
- /** @var BitrixInstaller */
17
- private $installer;
18
-
19
- /** @var Composer */
20
- private $composer;
21
-
22
-
23
- /**
24
- * Sets up the fixture, for example, instantiate the class-under-test.
25
- *
26
- * This method is called before a test is executed.
27
- */
28
- final function setUp()
29
- {
30
- $this->composer = new Composer();
31
- }
32
-
33
- /**
34
- * @param string $vars
35
- * @param string $expectedVars
36
- *
37
- * @covers ::inflectPackageVars
38
- *
39
- * @dataProvider provideExpectedInflectionResults
40
- */
41
- final public function testInflectPackageVars($vars, $expectedVars)
42
- {
43
-
44
- $this->installer = new BitrixInstaller(
45
- new Package($vars['name'], '4.2', '4.2'),
46
- $this->composer
47
- );
48
- $actual = $this->installer->inflectPackageVars($vars);
49
- $this->assertEquals($actual, $expectedVars);
50
- }
51
-
52
- /**
53
- * Provides various parameters for packages and the expected result after inflection
54
- *
55
- * @return array
56
- */
57
- final public function provideExpectedInflectionResults()
58
- {
59
- return array(
60
- //check bitrix-dir is correct
61
- array(
62
- array('name' => 'Nyan/Cat'),
63
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
64
- ),
65
- array(
66
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'),
67
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
68
- ),
69
- array(
70
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'),
71
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local')
72
- ),
73
- );
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php DELETED
@@ -1,114 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\CakePHPInstaller;
5
- use Composer\Repository\RepositoryManager;
6
- use Composer\Repository\InstalledArrayRepository;
7
- use Composer\Package\Package;
8
- use Composer\Package\RootPackage;
9
- use Composer\Package\Version\VersionParser;
10
- use Composer\Composer;
11
- use Composer\Config;
12
-
13
- class CakePHPInstallerTest extends TestCase
14
- {
15
- private $composer;
16
- private $io;
17
-
18
- /**
19
- * setUp
20
- *
21
- * @return void
22
- */
23
- public function setUp()
24
- {
25
- $this->package = new Package('CamelCased', '1.0', '1.0');
26
- $this->io = $this->getMock('Composer\IO\PackageInterface');
27
- $this->composer = new Composer();
28
- $this->composer->setConfig(new Config(false));
29
- }
30
-
31
- /**
32
- * testInflectPackageVars
33
- *
34
- * @return void
35
- */
36
- public function testInflectPackageVars()
37
- {
38
- $installer = new CakePHPInstaller($this->package, $this->composer);
39
- $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
40
- $this->assertEquals($result, array('name' => 'CamelCased'));
41
-
42
- $installer = new CakePHPInstaller($this->package, $this->composer);
43
- $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
44
- $this->assertEquals($result, array('name' => 'WithDash'));
45
-
46
- $installer = new CakePHPInstaller($this->package, $this->composer);
47
- $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
48
- $this->assertEquals($result, array('name' => 'WithUnderscore'));
49
-
50
- $installer = new CakePHPInstaller($this->package, $this->composer);
51
- $result = $installer->inflectPackageVars(array('name' => 'cake/acl'));
52
- $this->assertEquals($result, array('name' => 'Cake/Acl'));
53
-
54
- $installer = new CakePHPInstaller($this->package, $this->composer);
55
- $result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit'));
56
- $this->assertEquals($result, array('name' => 'Cake/DebugKit'));
57
- }
58
-
59
- /**
60
- * Test getLocations returning appropriate values based on CakePHP version
61
- *
62
- */
63
- public function testGetLocations() {
64
- $package = new RootPackage('CamelCased', '1.0', '1.0');
65
- $composer = $this->composer;
66
- $rm = new RepositoryManager(
67
- $this->getMock('Composer\IO\IOInterface'),
68
- $this->getMock('Composer\Config')
69
- );
70
- $composer->setRepositoryManager($rm);
71
- $installer = new CakePHPInstaller($package, $composer);
72
-
73
- // 2.0 < cakephp < 3.0
74
- $this->setCakephpVersion($rm, '2.0.0');
75
- $result = $installer->getLocations();
76
- $this->assertContains('Plugin/', $result['plugin']);
77
-
78
- $this->setCakephpVersion($rm, '2.5.9');
79
- $result = $installer->getLocations();
80
- $this->assertContains('Plugin/', $result['plugin']);
81
-
82
- $this->setCakephpVersion($rm, '~2.5');
83
- $result = $installer->getLocations();
84
- $this->assertContains('Plugin/', $result['plugin']);
85
-
86
- // special handling for 2.x versions when 3.x is still in development
87
- $this->setCakephpVersion($rm, 'dev-master');
88
- $result = $installer->getLocations();
89
- $this->assertContains('Plugin/', $result['plugin']);
90
-
91
- $this->setCakephpVersion($rm, '>=2.5');
92
- $result = $installer->getLocations();
93
- $this->assertContains('Plugin/', $result['plugin']);
94
-
95
- // cakephp >= 3.0
96
- $this->setCakephpVersion($rm, '3.0.*-dev');
97
- $result = $installer->getLocations();
98
- $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
99
-
100
- $this->setCakephpVersion($rm, '~8.8');
101
- $result = $installer->getLocations();
102
- $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
103
- }
104
-
105
- protected function setCakephpVersion($rm, $version) {
106
- $parser = new VersionParser();
107
- list(, $version) = explode(' ', $parser->parseConstraints($version));
108
- $installed = new InstalledArrayRepository();
109
- $package = new Package('cakephp/cakephp', $version, $version);
110
- $installed->addPackage($package);
111
- $rm->setLocalRepository($installed);
112
- }
113
-
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers\Test;
4
-
5
- use Composer\Installers\CraftInstaller;
6
-
7
- /**
8
- * Tests for the CraftInstaller Class
9
- *
10
- * @coversDefaultClass Composer\Installers\CraftInstaller
11
- */
12
- class CraftInstallerTest extends TestCase
13
- {
14
- /** @var CraftInstaller */
15
- private $installer;
16
-
17
- /**
18
- * Sets up the fixture, for example, instantiate the class-under-test.
19
- *
20
- * This method is called before a test is executed.
21
- */
22
- final public function setup()
23
- {
24
- $this->installer = new CraftInstaller();
25
- }
26
-
27
- /**
28
- * @param string $packageName
29
- * @param string $expectedName
30
- *
31
- * @covers ::inflectPackageVars
32
- *
33
- * @dataProvider provideExpectedInflectionResults
34
- */
35
- final public function testInflectPackageVars($packageName, $expectedName)
36
- {
37
- $installer = $this->installer;
38
-
39
- $vars = array('name' => $packageName);
40
- $expected = array('name' => $expectedName);
41
-
42
- $actual = $installer->inflectPackageVars($vars);
43
-
44
- $this->assertEquals($actual, $expected);
45
- }
46
-
47
- /**
48
- * Provides various names for packages and the expected result after inflection
49
- *
50
- * @return array
51
- */
52
- final public function provideExpectedInflectionResults()
53
- {
54
- return array(
55
- // lowercase
56
- array('foo', 'foo'),
57
- array('craftfoo', 'craftfoo'),
58
- array('fooplugin', 'fooplugin'),
59
- array('craftfooplugin', 'craftfooplugin'),
60
- // lowercase - dash
61
- array('craft-foo', 'foo'),
62
- array('foo-plugin', 'foo'),
63
- array('craft-foo-plugin', 'foo'),
64
- // lowercase - underscore
65
- array('craft_foo', 'craft_foo'),
66
- array('foo_plugin', 'foo_plugin'),
67
- array('craft_foo_plugin', 'craft_foo_plugin'),
68
- // CamelCase
69
- array('Foo', 'Foo'),
70
- array('CraftFoo', 'CraftFoo'),
71
- array('FooPlugin', 'FooPlugin'),
72
- array('CraftFooPlugin', 'CraftFooPlugin'),
73
- // CamelCase - Dash
74
- array('Craft-Foo', 'Foo'),
75
- array('Foo-Plugin', 'Foo'),
76
- array('Craft-Foo-Plugin', 'Foo'),
77
- // CamelCase - underscore
78
- array('Craft_Foo', 'Craft_Foo'),
79
- array('Foo_Plugin', 'Foo_Plugin'),
80
- array('Craft_Foo_Plugin', 'Craft_Foo_Plugin'),
81
- );
82
- }
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\DokuWikiInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class DokuWikiInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var DokuWikiInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new DokuWikiInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
31
- array('name' => $expected, 'type'=>$type)
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- array(
39
- 'dokuwiki-plugin',
40
- 'dokuwiki-test-plugin',
41
- 'test',
42
- ),
43
- array(
44
- 'dokuwiki-plugin',
45
- 'test-plugin',
46
- 'test',
47
- ),
48
- array(
49
- 'dokuwiki-plugin',
50
- 'dokuwiki_test',
51
- 'test',
52
- ),
53
- array(
54
- 'dokuwiki-plugin',
55
- 'test',
56
- 'test',
57
- ),
58
- array(
59
- 'dokuwiki-plugin',
60
- 'test-template',
61
- 'test-template',
62
- ),
63
- array(
64
- 'dokuwiki-template',
65
- 'dokuwiki-test-template',
66
- 'test',
67
- ),
68
- array(
69
- 'dokuwiki-template',
70
- 'test-template',
71
- 'test',
72
- ),
73
- array(
74
- 'dokuwiki-template',
75
- 'dokuwiki_test',
76
- 'test',
77
- ),
78
- array(
79
- 'dokuwiki-template',
80
- 'test',
81
- 'test',
82
- ),
83
- array(
84
- 'dokuwiki-template',
85
- 'test-plugin',
86
- 'test-plugin',
87
- ),
88
- );
89
- }
90
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\GravInstaller;
6
-
7
- class GravInstallerTest extends TestCase
8
- {
9
- /* @var \Composer\Composer */
10
- protected $composer;
11
-
12
- public function setUp()
13
- {
14
- $this->composer = new Composer();
15
- }
16
-
17
- public function testInflectPackageVars()
18
- {
19
- $package = $this->getPackage('vendor/name', '0.0.0');
20
- $installer = new GravInstaller($package, $this->composer);
21
- $packageVars = $this->getPackageVars($package);
22
-
23
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => 'test')));
24
- $this->assertEquals('test', $result['name']);
25
-
26
- foreach ($installer->getLocations() as $name => $location) {
27
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test")));
28
- $this->assertEquals('test', $result['name']);
29
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-$name")));
30
- $this->assertEquals('test', $result['name']);
31
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test-test")));
32
- $this->assertEquals('test-test', $result['name']);
33
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-test-$name")));
34
- $this->assertEquals('test-test', $result['name']);
35
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test")));
36
- $this->assertEquals('test', $result['name']);
37
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-$name")));
38
- $this->assertEquals('test', $result['name']);
39
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test-test")));
40
- $this->assertEquals('test-test', $result['name']);
41
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-test-$name")));
42
- $this->assertEquals('test-test', $result['name']);
43
- }
44
- }
45
-
46
- /**
47
- * @param $package \Composer\Package\PackageInterface
48
- */
49
- public function getPackageVars($package)
50
- {
51
- $type = $package->getType();
52
-
53
- $prettyName = $package->getPrettyName();
54
- if (strpos($prettyName, '/') !== false) {
55
- list($vendor, $name) = explode('/', $prettyName);
56
- } else {
57
- $vendor = '';
58
- $name = $prettyName;
59
- }
60
-
61
- return compact('name', 'vendor', 'type');
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php DELETED
@@ -1,552 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\Installer;
5
- use Composer\Util\Filesystem;
6
- use Composer\Package\Package;
7
- use Composer\Package\RootPackage;
8
- use Composer\Composer;
9
- use Composer\Config;
10
-
11
- class InstallerTest extends TestCase
12
- {
13
- private $composer;
14
- private $config;
15
- private $vendorDir;
16
- private $binDir;
17
- private $dm;
18
- private $repository;
19
- private $io;
20
- private $fs;
21
-
22
- /**
23
- * setUp
24
- *
25
- * @return void
26
- */
27
- public function setUp()
28
- {
29
- $this->fs = new Filesystem;
30
-
31
- $this->composer = new Composer();
32
- $this->config = new Config();
33
- $this->composer->setConfig($this->config);
34
-
35
- $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
36
- $this->ensureDirectoryExistsAndClear($this->vendorDir);
37
-
38
- $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
39
- $this->ensureDirectoryExistsAndClear($this->binDir);
40
-
41
- $this->config->merge(array(
42
- 'config' => array(
43
- 'vendor-dir' => $this->vendorDir,
44
- 'bin-dir' => $this->binDir,
45
- ),
46
- ));
47
-
48
- $this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
49
- ->disableOriginalConstructor()
50
- ->getMock();
51
- $this->composer->setDownloadManager($this->dm);
52
-
53
- $this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
54
- $this->io = $this->getMock('Composer\IO\IOInterface');
55
- }
56
-
57
- /**
58
- * tearDown
59
- *
60
- * @return void
61
- */
62
- public function tearDown()
63
- {
64
- $this->fs->removeDirectory($this->vendorDir);
65
- $this->fs->removeDirectory($this->binDir);
66
- }
67
-
68
- /**
69
- * testSupports
70
- *
71
- * @return void
72
- *
73
- * @dataProvider dataForTestSupport
74
- */
75
- public function testSupports($type, $expected)
76
- {
77
- $installer = new Installer($this->io, $this->composer);
78
- $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
79
- }
80
-
81
- /**
82
- * dataForTestSupport
83
- */
84
- public function dataForTestSupport()
85
- {
86
- return array(
87
- array('agl-module', true),
88
- array('aimeos-extension', true),
89
- array('annotatecms-module', true),
90
- array('annotatecms-component', true),
91
- array('annotatecms-service', true),
92
- array('attogram-module', true),
93
- array('bitrix-module', true),
94
- array('bitrix-component', true),
95
- array('bitrix-theme', true),
96
- array('bonefish-package', true),
97
- array('cakephp', false),
98
- array('cakephp-', false),
99
- array('cakephp-app', false),
100
- array('cakephp-plugin', true),
101
- array('chef-cookbook', true),
102
- array('chef-role', true),
103
- array('cockpit-module', true),
104
- array('codeigniter-app', false),
105
- array('codeigniter-library', true),
106
- array('codeigniter-third-party', true),
107
- array('codeigniter-module', true),
108
- array('concrete5-block', true),
109
- array('concrete5-package', true),
110
- array('concrete5-theme', true),
111
- array('concrete5-core', true),
112
- array('concrete5-update', true),
113
- array('craft-plugin', true),
114
- array('croogo-plugin', true),
115
- array('croogo-theme', true),
116
- array('decibel-app', true),
117
- array('dokuwiki-plugin', true),
118
- array('dokuwiki-template', true),
119
- array('drupal-module', true),
120
- array('dolibarr-module', true),
121
- array('ee3-theme', true),
122
- array('ee3-addon', true),
123
- array('ee2-theme', true),
124
- array('ee2-addon', true),
125
- array('elgg-plugin', true),
126
- array('eliasis-component', true),
127
- array('eliasis-module', true),
128
- array('eliasis-plugin', true),
129
- array('eliasis-template', true),
130
- array('ezplatform-assets', true),
131
- array('ezplatform-meta-assets', true),
132
- array('fuel-module', true),
133
- array('fuel-package', true),
134
- array('fuel-theme', true),
135
- array('fuelphp-component', true),
136
- array('hurad-plugin', true),
137
- array('hurad-theme', true),
138
- array('imagecms-template', true),
139
- array('imagecms-module', true),
140
- array('imagecms-library', true),
141
- array('itop-extension', true),
142
- array('joomla-library', true),
143
- array('kanboard-plugin', true),
144
- array('kirby-plugin', true),
145
- array('kohana-module', true),
146
- array('lms-plugin', true),
147
- array('lms-template', true),
148
- array('lms-document-template', true),
149
- array('lms-userpanel-module', true),
150
- array('laravel-library', true),
151
- array('lavalite-theme', true),
152
- array('lavalite-package', true),
153
- array('lithium-library', true),
154
- array('magento-library', true),
155
- array('majima-plugin', true),
156
- array('mako-package', true),
157
- array('modx-extra', true),
158
- array('modxevo-snippet', true),
159
- array('modxevo-plugin', true),
160
- array('modxevo-module', true),
161
- array('modxevo-template', true),
162
- array('modxevo-lib', true),
163
- array('mediawiki-extension', true),
164
- array('mediawiki-skin', true),
165
- array('microweber-module', true),
166
- array('modulework-module', true),
167
- array('moodle-mod', true),
168
- array('october-module', true),
169
- array('october-plugin', true),
170
- array('piwik-plugin', true),
171
- array('pxcms-module', true),
172
- array('pxcms-theme', true),
173
- array('phpbb-extension', true),
174
- array('pimcore-plugin', true),
175
- array('plentymarkets-plugin', true),
176
- array('ppi-module', true),
177
- array('prestashop-module', true),
178
- array('prestashop-theme', true),
179
- array('puppet-module', true),
180
- array('porto-container', true),
181
- array('radphp-bundle', true),
182
- array('redaxo-addon', true),
183
- array('redaxo-bestyle-plugin', true),
184
- array('reindex-theme', true),
185
- array('reindex-plugin', true),
186
- array('roundcube-plugin', true),
187
- array('shopware-backend-plugin', true),
188
- array('shopware-core-plugin', true),
189
- array('shopware-frontend-plugin', true),
190
- array('shopware-theme', true),
191
- array('shopware-plugin', true),
192
- array('shopware-frontend-theme', true),
193
- array('silverstripe-module', true),
194
- array('silverstripe-theme', true),
195
- array('smf-module', true),
196
- array('smf-theme', true),
197
- array('sydes-module', true),
198
- array('sydes-theme', true),
199
- array('symfony1-plugin', true),
200
- array('thelia-module', true),
201
- array('thelia-frontoffice-template', true),
202
- array('thelia-backoffice-template', true),
203
- array('thelia-email-template', true),
204
- array('tusk-task', true),
205
- array('tusk-asset', true),
206
- array('typo3-flow-plugin', true),
207
- array('typo3-cms-extension', true),
208
- array('userfrosting-sprinkle', true),
209
- array('vanilla-plugin', true),
210
- array('vanilla-theme', true),
211
- array('whmcs-gateway', true),
212
- array('wolfcms-plugin', true),
213
- array('wordpress-plugin', true),
214
- array('wordpress-core', false),
215
- array('yawik-module', true),
216
- array('zend-library', true),
217
- array('zikula-module', true),
218
- array('zikula-theme', true),
219
- array('kodicms-plugin', true),
220
- array('kodicms-media', true),
221
- array('phifty-bundle', true),
222
- array('phifty-library', true),
223
- array('phifty-framework', true),
224
- array('osclass-plugin', true),
225
- array('osclass-theme', true),
226
- array('osclass-language', true),
227
- );
228
- }
229
-
230
- /**
231
- * testInstallPath
232
- *
233
- * @dataProvider dataForTestInstallPath
234
- */
235
- public function testInstallPath($type, $path, $name, $version = '1.0.0')
236
- {
237
- $installer = new Installer($this->io, $this->composer);
238
- $package = new Package($name, $version, $version);
239
-
240
- $package->setType($type);
241
- $result = $installer->getInstallPath($package);
242
- $this->assertEquals($path, $result);
243
- }
244
-
245
- /**
246
- * dataFormTestInstallPath
247
- */
248
- public function dataForTestInstallPath()
249
- {
250
- return array(
251
- array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
252
- array('aimeos-extension', 'ext/ai-test/', 'author/ai-test'),
253
- array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
254
- array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
255
- array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
256
- array('attogram-module', 'modules/my_module/', 'author/my_module'),
257
- array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
258
- array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
259
- array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
260
- array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),
261
- array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),
262
- array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),
263
- array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
264
- array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
265
- array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
266
- array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
267
- array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),
268
- array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
269
- array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
270
- array('concrete5-block', 'application/blocks/concrete5_block/', 'remo/concrete5_block'),
271
- array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
272
- array('concrete5-theme', 'application/themes/concrete5_theme/', 'remo/concrete5_theme'),
273
- array('concrete5-core', 'concrete/', 'concrete5/core'),
274
- array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),
275
- array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
276
- array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
277
- array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
278
- array('decibel-app', 'app/someapp/', 'author/someapp'),
279
- array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
280
- array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
281
- array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
282
- array('drupal-module', 'modules/my_module/', 'shama/my_module'),
283
- array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
284
- array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
285
- array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
286
- array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
287
- array('eliasis-component', 'components/my_component/', 'shama/my_component'),
288
- array('eliasis-module', 'modules/my_module/', 'shama/my_module'),
289
- array('eliasis-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
290
- array('eliasis-template', 'templates/my_template/', 'shama/my_template'),
291
- array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
292
- array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
293
- array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),
294
- array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),
295
- array('ezplatform-assets', 'web/assets/ezplatform/ezplatform_comp/', 'author/ezplatform_comp'),
296
- array('ezplatform-meta-assets', 'web/assets/ezplatform/', 'author/ezplatform_comp'),
297
- array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
298
- array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
299
- array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
300
- array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
301
- array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
302
- array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
303
- array('imagecms-template', 'templates/my_template/', 'shama/my_template'),
304
- array('imagecms-module', 'application/modules/my_module/', 'shama/my_module'),
305
- array('imagecms-library', 'application/libraries/my_library/', 'shama/my_library'),
306
- array('itop-extension', 'extensions/my_extension/', 'shama/my_extension'),
307
- array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
308
- array('kanboard-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
309
- array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
310
- array('kohana-module', 'modules/my_package/', 'shama/my_package'),
311
- array('lms-plugin', 'plugins/MyPackage/', 'shama/MyPackage'),
312
- array('lms-plugin', 'plugins/MyPackage/', 'shama/my_package'),
313
- array('lms-template', 'templates/MyPackage/', 'shama/MyPackage'),
314
- array('lms-template', 'templates/MyPackage/', 'shama/my_package'),
315
- array('lms-document-template', 'documents/templates/MyPackage/', 'shama/MyPackage'),
316
- array('lms-document-template', 'documents/templates/MyPackage/', 'shama/my_package'),
317
- array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/MyPackage'),
318
- array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/my_package'),
319
- array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
320
- array('lavalite-theme', 'public/themes/my_theme/', 'shama/my_theme'),
321
- array('lavalite-package', 'packages/my_group/my_package/', 'my_group/my_package'),
322
- array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
323
- array('magento-library', 'lib/foo/', 'test/foo'),
324
- array('majima-plugin', 'plugins/MyPlugin/', 'shama/my-plugin'),
325
- array('modx-extra', 'core/packages/extra/', 'vendor/extra'),
326
- array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),
327
- array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),
328
- array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),
329
- array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),
330
- array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),
331
- array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
332
- array('mediawiki-extension', 'extensions/APC/', 'author/APC'),
333
- array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),
334
- array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),
335
- array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),
336
- array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),
337
- array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),
338
- array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),
339
- array('modulework-module', 'modules/my_package/', 'shama/my_package'),
340
- array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
341
- array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
342
- array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
343
- array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
344
- array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
345
- array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
346
- array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),
347
- array('pxcms-module', 'app/Modules/Foo/', 'vendor/module-foo'),
348
- array('pxcms-module', 'app/Modules/Foo/', 'vendor/pxcms-foo'),
349
- array('pxcms-theme', 'themes/Foo/', 'vendor/theme-foo'),
350
- array('pxcms-theme', 'themes/Foo/', 'vendor/pxcms-foo'),
351
- array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
352
- array('phpbb-style', 'styles/foo/', 'test/foo'),
353
- array('phpbb-language', 'language/foo/', 'test/foo'),
354
- array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
355
- array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
356
- array('ppi-module', 'modules/foo/', 'test/foo'),
357
- array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
358
- array('porto-container', 'app/Containers/container-name/', 'test/container-name'),
359
- array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
360
- array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
361
- array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
362
- array('reindex-theme', 'themes/my_module/', 'author/my_module'),
363
- array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),
364
- array('roundcube-plugin', 'plugins/base/', 'test/base'),
365
- array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
366
- array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
367
- array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
368
- array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
369
- array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
370
- array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),
371
- array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),
372
- array('silverstripe-module', 'my_module/', 'shama/my_module'),
373
- array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
374
- array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
375
- array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
376
- array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
377
- array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
378
- array('smf-module', 'Sources/my_module/', 'shama/my_module'),
379
- array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),
380
- array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
381
- array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
382
- array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),
383
- array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),
384
- array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),
385
- array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),
386
- array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),
387
- array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
388
- array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
389
- array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
390
- array('userfrosting-sprinkle', 'app/sprinkles/my_sprinkle/', 'shama/my_sprinkle'),
391
- array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
392
- array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
393
- array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
394
- array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
395
- array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
396
- array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
397
- array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
398
- array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
399
- array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
400
- array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
401
- array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
402
- array('phifty-bundle', 'bundles/core/', 'shama/core'),
403
- array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
404
- array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
405
- array('yawik-module', 'module/MyModule/', 'shama/my_module'),
406
- array('osclass-plugin', 'oc-content/plugins/sample_plugin/', 'test/sample_plugin'),
407
- array('osclass-theme', 'oc-content/themes/sample_theme/', 'test/sample_theme'),
408
- array('osclass-language', 'oc-content/languages/sample_lang/', 'test/sample_lang'),
409
- );
410
- }
411
-
412
- /**
413
- * testGetCakePHPInstallPathException
414
- *
415
- * @return void
416
- *
417
- * @expectedException \InvalidArgumentException
418
- */
419
- public function testGetCakePHPInstallPathException()
420
- {
421
- $installer = new Installer($this->io, $this->composer);
422
- $package = new Package('shama/ftp', '1.0.0', '1.0.0');
423
-
424
- $package->setType('cakephp-whoops');
425
- $result = $installer->getInstallPath($package);
426
- }
427
-
428
- /**
429
- * testCustomInstallPath
430
- */
431
- public function testCustomInstallPath()
432
- {
433
- $installer = new Installer($this->io, $this->composer);
434
- $package = new Package('shama/ftp', '1.0.0', '1.0.0');
435
- $package->setType('cakephp-plugin');
436
- $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
437
- $this->composer->setPackage($consumerPackage);
438
- $consumerPackage->setExtra(array(
439
- 'installer-paths' => array(
440
- 'my/custom/path/{$name}/' => array(
441
- 'shama/ftp',
442
- 'foo/bar',
443
- ),
444
- ),
445
- ));
446
- $result = $installer->getInstallPath($package);
447
- $this->assertEquals('my/custom/path/Ftp/', $result);
448
- }
449
-
450
- /**
451
- * testCustomInstallerName
452
- */
453
- public function testCustomInstallerName()
454
- {
455
- $installer = new Installer($this->io, $this->composer);
456
- $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
457
- $package->setType('cakephp-plugin');
458
- $package->setExtra(array(
459
- 'installer-name' => 'FTP',
460
- ));
461
- $result = $installer->getInstallPath($package);
462
- $this->assertEquals('Plugin/FTP/', $result);
463
- }
464
-
465
- /**
466
- * testCustomTypePath
467
- */
468
- public function testCustomTypePath()
469
- {
470
- $installer = new Installer($this->io, $this->composer);
471
- $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
472
- $package->setType('wordpress-plugin');
473
- $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
474
- $this->composer->setPackage($consumerPackage);
475
- $consumerPackage->setExtra(array(
476
- 'installer-paths' => array(
477
- 'my/custom/path/{$name}/' => array(
478
- 'type:wordpress-plugin'
479
- ),
480
- ),
481
- ));
482
- $result = $installer->getInstallPath($package);
483
- $this->assertEquals('my/custom/path/my_plugin/', $result);
484
- }
485
-
486
- /**
487
- * testVendorPath
488
- */
489
- public function testVendorPath()
490
- {
491
- $installer = new Installer($this->io, $this->composer);
492
- $package = new Package('penyaskito/my_module', '1.0.0', '1.0.0');
493
- $package->setType('drupal-module');
494
- $consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0');
495
- $this->composer->setPackage($consumerPackage);
496
- $consumerPackage->setExtra(array(
497
- 'installer-paths' => array(
498
- 'modules/custom/{$name}/' => array(
499
- 'vendor:penyaskito'
500
- ),
501
- ),
502
- ));
503
- $result = $installer->getInstallPath($package);
504
- $this->assertEquals('modules/custom/my_module/', $result);
505
- }
506
-
507
- /**
508
- * testNoVendorName
509
- */
510
- public function testNoVendorName()
511
- {
512
- $installer = new Installer($this->io, $this->composer);
513
- $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
514
-
515
- $package->setType('symfony1-plugin');
516
- $result = $installer->getInstallPath($package);
517
- $this->assertEquals('plugins/sfPhpunitPlugin/', $result);
518
- }
519
-
520
- /**
521
- * testTypo3Inflection
522
- */
523
- public function testTypo3Inflection()
524
- {
525
- $installer = new Installer($this->io, $this->composer);
526
- $package = new Package('typo3/fluid', '1.0.0', '1.0.0');
527
-
528
- $package->setAutoload(array(
529
- 'psr-0' => array(
530
- 'TYPO3\\Fluid' => 'Classes',
531
- ),
532
- ));
533
-
534
- $package->setType('typo3-flow-package');
535
- $result = $installer->getInstallPath($package);
536
- $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
537
- }
538
-
539
- public function testUninstallAndDeletePackageFromLocalRepo()
540
- {
541
- $package = new Package('foo', '1.0.0', '1.0.0');
542
-
543
- $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
544
- $installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
545
-
546
- $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
547
- $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
548
- $repo->expects($this->once())->method('removePackage')->with($package);
549
-
550
- $installer->uninstall($repo, $package);
551
- }
552
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\MayaInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class MayaInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var MayaInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new MayaInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // Should keep module name StudlyCase
39
- array(
40
- 'maya-module',
41
- 'user-profile',
42
- 'UserProfile'
43
- ),
44
- array(
45
- 'maya-module',
46
- 'maya-module',
47
- 'Maya'
48
- ),
49
- array(
50
- 'maya-module',
51
- 'blog',
52
- 'Blog'
53
- ),
54
- // tests that exactly one '-module' is cut off
55
- array(
56
- 'maya-module',
57
- 'some-module-module',
58
- 'SomeModule',
59
- ),
60
- );
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\MediaWikiInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class MediaWikiInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var MediaWikiInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new MediaWikiInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
31
- array('name' => $expected, 'type'=>$type)
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- array(
39
- 'mediawiki-extension',
40
- 'sub-page-list',
41
- 'SubPageList',
42
- ),
43
- array(
44
- 'mediawiki-extension',
45
- 'sub-page-list-extension',
46
- 'SubPageList',
47
- ),
48
- array(
49
- 'mediawiki-extension',
50
- 'semantic-mediawiki',
51
- 'SemanticMediawiki',
52
- ),
53
- // tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions
54
- array(
55
- 'mediawiki-skin',
56
- 'some-skin-skin',
57
- 'some-skin',
58
- ),
59
- // tests that names without '-skin' suffix stay valid
60
- array(
61
- 'mediawiki-skin',
62
- 'someotherskin',
63
- 'someotherskin',
64
- ),
65
- );
66
- }
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\OctoberInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class OctoberInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var OctoberInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new OctoberInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
31
- array('name' => $expected, 'type' => $type)
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- array(
39
- 'october-plugin',
40
- 'subpagelist',
41
- 'subpagelist',
42
- ),
43
- array(
44
- 'october-plugin',
45
- 'subpagelist-plugin',
46
- 'subpagelist',
47
- ),
48
- array(
49
- 'october-plugin',
50
- 'semanticoctober',
51
- 'semanticoctober',
52
- ),
53
- // tests that exactly one '-theme' is cut off
54
- array(
55
- 'october-theme',
56
- 'some-theme-theme',
57
- 'some-theme',
58
- ),
59
- // tests that names without '-theme' suffix stay valid
60
- array(
61
- 'october-theme',
62
- 'someothertheme',
63
- 'someothertheme',
64
- ),
65
- );
66
- }
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\OntoWikiInstaller;
5
- use PHPUnit\Framework\TestCase as BaseTestCase;
6
-
7
- /**
8
- * Test for the OntoWikiInstaller
9
- * code was taken from DokuWikiInstaller
10
- */
11
- class OntoWikiInstallerTest extends BaseTestCase
12
- {
13
- /**
14
- * @var OntoWikiInstaller
15
- */
16
- private $installer;
17
-
18
- public function setUp()
19
- {
20
- $this->installer = new OntoWikiInstaller();
21
- }
22
-
23
- /**
24
- * @dataProvider packageNameInflectionProvider
25
- */
26
- public function testInflectPackageVars($type, $name, $expected)
27
- {
28
- $this->assertEquals(
29
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
30
- array('name' => $expected, 'type'=>$type)
31
- );
32
- }
33
-
34
- public function packageNameInflectionProvider()
35
- {
36
- return array(
37
- array(
38
- 'ontowiki-extension',
39
- 'CSVImport.ontowiki',
40
- 'csvimport',
41
- ),
42
- array(
43
- 'ontowiki-extension',
44
- 'csvimport',
45
- 'csvimport',
46
- ),
47
- array(
48
- 'ontowiki-extension',
49
- 'some_ontowiki_extension',
50
- 'some_ontowiki_extension',
51
- ),
52
- array(
53
- 'ontowiki-extension',
54
- 'some_ontowiki_extension.ontowiki',
55
- 'some_ontowiki_extension',
56
- ),
57
- array(
58
- 'ontowiki-translation',
59
- 'de-translation.ontowiki',
60
- 'de',
61
- ),
62
- array(
63
- 'ontowiki-translation',
64
- 'en-US-translation.ontowiki',
65
- 'en-us',
66
- ),
67
- array(
68
- 'ontowiki-translation',
69
- 'en-US-translation',
70
- 'en-us',
71
- ),
72
- array(
73
- 'ontowiki-theme',
74
- 'blue-theme.ontowiki',
75
- 'blue',
76
- ),
77
- array(
78
- 'ontowiki-theme',
79
- 'blue-theme',
80
- 'blue',
81
- ),
82
- );
83
- }
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\PimcoreInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class PimcoreInstallerTest extends TestCase
9
- {
10
- private $composer;
11
- private $io;
12
-
13
- /**
14
- * setUp
15
- *
16
- * @return void
17
- */
18
- public function setUp()
19
- {
20
- $this->package = new Package('CamelCased', '1.0', '1.0');
21
- $this->io = $this->getMock('Composer\IO\PackageInterface');
22
- $this->composer = new Composer();
23
- }
24
-
25
- /**
26
- * testInflectPackageVars
27
- *
28
- * @return void
29
- */
30
- public function testInflectPackageVars()
31
- {
32
- $installer = new PimcoreInstaller($this->package, $this->composer);
33
- $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
34
- $this->assertEquals($result, array('name' => 'CamelCased'));
35
-
36
- $installer = new PimcoreInstaller($this->package, $this->composer);
37
- $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
38
- $this->assertEquals($result, array('name' => 'WithDash'));
39
-
40
- $installer = new PimcoreInstaller($this->package, $this->composer);
41
- $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
42
- $this->assertEquals($result, array('name' => 'WithUnderscore'));
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\PiwikInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Package\PackageInterface;
8
-
9
- /**
10
- * Class PiwikInstallerTest
11
- *
12
- * @package Composer\Installers\Test
13
- */
14
- class PiwikInstallerTest extends TestCase
15
- {
16
- /**
17
- * @varComposer
18
- */
19
- private $composer;
20
-
21
- /**
22
- * @var PackageInterface
23
- */
24
- private $io;
25
-
26
- /**
27
- * @var Package
28
- */
29
- private $package;
30
-
31
- /**
32
- * setUp
33
- *
34
- * @return void
35
- */
36
- public function setUp()
37
- {
38
- $this->package = new Package('VisitSummary', '1.0', '1.0');
39
- $this->io = $this->getMock('Composer\IO\PackageInterface');
40
- $this->composer = new Composer();
41
- }
42
-
43
- /**
44
- * testInflectPackageVars
45
- *
46
- * @return void
47
- */
48
- public function testInflectPackageVars()
49
- {
50
- $installer = new PiwikInstaller($this->package, $this->composer);
51
- $result = $installer->inflectPackageVars(array('name' => 'VisitSummary'));
52
- $this->assertEquals($result, array('name' => 'VisitSummary'));
53
-
54
- $installer = new PiwikInstaller($this->package, $this->composer);
55
- $result = $installer->inflectPackageVars(array('name' => 'visit-summary'));
56
- $this->assertEquals($result, array('name' => 'VisitSummary'));
57
-
58
- $installer = new PiwikInstaller($this->package, $this->composer);
59
- $result = $installer->inflectPackageVars(array('name' => 'visit_summary'));
60
- $this->assertEquals($result, array('name' => 'VisitSummary'));
61
- }
62
-
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers\Test;
4
-
5
- use Composer\Composer;
6
- use Composer\Installers\SiteDirectInstaller;
7
- use Composer\Package\Package;
8
-
9
- class SiteDirectInstallerTest extends TestCase
10
- {
11
- /** @var SiteDirectInstaller $installer */
12
- protected $installer;
13
-
14
- /** @var Package */
15
- private $package;
16
-
17
- public function SetUp()
18
- {
19
- $this->package = new Package('sitedirect/some_name', '1.0.9', '1.0');
20
- $this->installer = new SiteDirectInstaller(
21
- $this->package,
22
- new Composer()
23
- );
24
-
25
- }
26
-
27
- /**
28
- * @dataProvider dataProvider
29
- */
30
- public function testInflectPackageVars($data, $expected)
31
- {
32
- $result = $this->installer->inflectPackageVars($data);
33
- $this->assertEquals($result, $expected);
34
- }
35
-
36
- /**
37
- * @dataProvider dataProvider
38
- */
39
- public function testInstallPath($data, $expected)
40
- {
41
- $result = $this->installer->inflectPackageVars($data);
42
- $path = $this->createPackage($data);
43
-
44
- // use $result to get the proper capitalization for the vendor path
45
- $expectedPath = "modules/{$result['vendor']}/{$result['name']}/";
46
- $notExpectedPath = "modules/{$data['vendor']}/{$data['name']}/";
47
- $this->assertEquals($expectedPath, $path);
48
- $this->assertNotEquals($notExpectedPath, $path);
49
- }
50
-
51
- /**
52
- * @param $data
53
- * @return string
54
- */
55
- private function createPackage($data)
56
- {
57
- $fullName = "{$data['vendor']}/{$data['name']}";
58
-
59
- $package = new Package($fullName, '1.0', '1.0');
60
- $package->setType('sitedirect-module');
61
- $installer = new SiteDirectInstaller($package, new Composer());
62
-
63
- $path = $installer->getInstallPath($package, 'sitedirect');
64
- return $path;
65
- }
66
-
67
- public function dataProvider()
68
- {
69
- return array(
70
- array(
71
- 'data' => array(
72
- 'name' => 'kernel',
73
- 'vendor' => 'sitedirect',
74
- 'type' => 'sitedirect-module',
75
- ),
76
- 'expected' => array(
77
- 'name' => 'Kernel',
78
- 'vendor' => 'SiteDirect',
79
- 'type' => 'sitedirect-module',
80
- )
81
- ),
82
- array(
83
- 'data' => array(
84
- 'name' => 'that_guy',
85
- 'vendor' => 'whatGuy',
86
- 'type' => 'sitedirect-module',
87
- ),
88
- 'expected' => array(
89
- 'name' => 'ThatGuy',
90
- 'vendor' => 'whatGuy',
91
- 'type' => 'sitedirect-module',
92
- )
93
- ),
94
- array(
95
- 'data' => array(
96
- 'name' => 'checkout',
97
- 'vendor' => 'someVendor',
98
- 'type' => 'sitedirect-plugin',
99
- ),
100
- 'expected' => array(
101
- 'name' => 'Checkout',
102
- 'vendor' => 'someVendor',
103
- 'type' => 'sitedirect-plugin',
104
- )
105
- ),
106
- array(
107
- 'data' => array(
108
- 'name' => 'checkout',
109
- 'vendor' => 'siteDirect',
110
- 'type' => 'sitedirect-plugin',
111
- ),
112
- 'expected' => array(
113
- 'name' => 'Checkout',
114
- 'vendor' => 'SiteDirect',
115
- 'type' => 'sitedirect-plugin',
116
- )
117
- ),
118
- );
119
- }
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\SyDESInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class SyDESInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var SyDESInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new SyDESInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // modules
39
- array(
40
- 'sydes-module',
41
- 'name',
42
- 'Name'
43
- ),
44
- array(
45
- 'sydes-module',
46
- 'sample-name',
47
- 'SampleName'
48
- ),
49
- array(
50
- 'sydes-module',
51
- 'sydes-name',
52
- 'Name'
53
- ),
54
- array(
55
- 'sydes-module',
56
- 'sample-name-module',
57
- 'SampleName',
58
- ),
59
- array(
60
- 'sydes-module',
61
- 'sydes-sample-name-module',
62
- 'SampleName'
63
- ),
64
- // themes
65
- array(
66
- 'sydes-theme',
67
- 'some-theme-theme',
68
- 'some-theme',
69
- ),
70
- array(
71
- 'sydes-theme',
72
- 'sydes-sometheme',
73
- 'sometheme',
74
- ),
75
- array(
76
- 'sydes-theme',
77
- 'Sample-Name',
78
- 'sample-name'
79
- ),
80
- );
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php DELETED
@@ -1,65 +0,0 @@
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\Installers\Test;
14
-
15
- use Composer\Package\Version\VersionParser;
16
- use Composer\Package\Package;
17
- use Composer\Package\AliasPackage;
18
- use Composer\Package\LinkConstraint\VersionConstraint;
19
- use Composer\Util\Filesystem;
20
- use PHPUnit\Framework\TestCase as BaseTestCase;
21
-
22
- abstract class TestCase extends BaseTestCase
23
- {
24
- private static $parser;
25
-
26
- protected static function getVersionParser()
27
- {
28
- if (!self::$parser) {
29
- self::$parser = new VersionParser();
30
- }
31
-
32
- return self::$parser;
33
- }
34
-
35
- protected function getVersionConstraint($operator, $version)
36
- {
37
- return new VersionConstraint(
38
- $operator,
39
- self::getVersionParser()->normalize($version)
40
- );
41
- }
42
-
43
- protected function getPackage($name, $version)
44
- {
45
- $normVersion = self::getVersionParser()->normalize($version);
46
-
47
- return new Package($name, $normVersion, $version);
48
- }
49
-
50
- protected function getAliasPackage($package, $version)
51
- {
52
- $normVersion = self::getVersionParser()->normalize($version);
53
-
54
- return new AliasPackage($package, $normVersion, $version);
55
- }
56
-
57
- protected function ensureDirectoryExistsAndClear($directory)
58
- {
59
- $fs = new Filesystem();
60
- if (is_dir($directory)) {
61
- $fs->removeDirectory($directory);
62
- }
63
- mkdir($directory, 0777, true);
64
- }
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\VgmcpInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class VgmcpInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var VgmcpInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new VgmcpInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // Should keep bundle name StudlyCase
39
- array(
40
- 'vgmcp-bundle',
41
- 'user-profile',
42
- 'UserProfile'
43
- ),
44
- array(
45
- 'vgmcp-bundle',
46
- 'vgmcp-bundle',
47
- 'Vgmcp'
48
- ),
49
- array(
50
- 'vgmcp-bundle',
51
- 'blog',
52
- 'Blog'
53
- ),
54
- // tests that exactly one '-bundle' is cut off
55
- array(
56
- 'vgmcp-bundle',
57
- 'some-bundle-bundle',
58
- 'SomeBundle',
59
- ),
60
- // tests that exactly one '-theme' is cut off
61
- array(
62
- 'vgmcp-theme',
63
- 'some-theme-theme',
64
- 'SomeTheme',
65
- ),
66
- // tests that names without '-theme' suffix stay valid
67
- array(
68
- 'vgmcp-theme',
69
- 'someothertheme',
70
- 'Someothertheme',
71
- ),
72
- // Should keep theme name StudlyCase
73
- array(
74
- 'vgmcp-theme',
75
- 'adminlte-advanced',
76
- 'AdminlteAdvanced'
77
- ),
78
- );
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\YawikInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Package\PackageInterface;
8
-
9
- /**
10
- * Class YawikInstallerTest
11
- *
12
- * @package Composer\Installers\Test
13
- */
14
- class YawikInstallerTest extends TestCase
15
- {
16
- /**
17
- * @varComposer
18
- */
19
- private $composer;
20
-
21
- /**
22
- * @var PackageInterface
23
- */
24
- private $io;
25
-
26
- /**
27
- * @var Package
28
- */
29
- private $package;
30
-
31
- /**
32
- * setUp
33
- *
34
- * @return void
35
- */
36
- public function setUp()
37
- {
38
- $this->package = new Package('YawikCompanyRegistration', '1.0', '1.0');
39
- $this->io = $this->getMock('Composer\IO\PackageInterface');
40
- $this->composer = new Composer();
41
- }
42
-
43
- /**
44
- * testInflectPackageVars
45
- *
46
- * @dataProvider packageNameProvider
47
- * @return void
48
- */
49
- public function testInflectPackageVars($input)
50
- {
51
- $installer = new YawikInstaller($this->package, $this->composer);
52
- $result = $installer->inflectPackageVars(array('name' => $input));
53
- $this->assertEquals($result, array('name' => 'YawikCompanyRegistration'));
54
- }
55
-
56
- public function packageNameProvider()
57
- {
58
- return array(
59
- array('yawik-company-registration'),
60
- array('yawik_company_registration'),
61
- array('YawikCompanyRegistration')
62
- );
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/bootstrap.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
-
3
- $loader = require __DIR__ . '/../src/bootstrap.php';
4
- $loader->add('Composer\Installers\Test', __DIR__);
 
 
 
 
vendor/vimeo/vimeo-api/.gitattributes DELETED
@@ -1 +0,0 @@
1
- /example export-ignore
 
vendor/vimeo/vimeo-api/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- composer.lock
2
- reports/
3
- vendor/
 
 
 
vendor/vimeo/vimeo-api/.styleci.yml DELETED
@@ -1,19 +0,0 @@
1
- preset: psr2
2
-
3
- enabled:
4
- - combine_consecutive_unsets
5
- - newline_after_open_tag
6
- - no_php4_constructor
7
- - no_useless_else
8
- - ordered_class_elements
9
- - ordered_use
10
- - strict
11
- - strict_param
12
- - php_unit_construct
13
- - php_unit_strict
14
-
15
- finder:
16
- exclude:
17
- - 'example'
18
- name:
19
- - '*.php'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- language: php
2
-
3
- dist: 'precise'
4
-
5
- php:
6
- - '5.3'
7
- - '5.4'
8
- - '5.5'
9
- - '5.6'
10
- - '7.0'
11
- - '7.1'
12
-
13
- cache:
14
- directories:
15
- - ./vendor
16
-
17
- install:
18
- - composer install
19
-
20
- script:
21
- - vendor/bin/phpunit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/CHANGELOG.md DELETED
@@ -1,19 +0,0 @@
1
- # CHANGELOG
2
-
3
- ## 1.2.1 (released 2015-05-07)
4
-
5
- - Move from pem to cer
6
-
7
- ## 1.2.0 (released 2015-05-01)
8
-
9
- - Better error messages when uploading (#66)
10
- - Better error messages when curl errors (#68)
11
- - Root cert is included to help with curl errors (#69)
12
-
13
- ## 1.1.0 (released 2014-10-23)
14
-
15
- - Added composer support (#6)
16
-
17
- ## 1.0.0 (released 2014-09-26)
18
-
19
- - This is the Vimeo library for version 3 of the Vimeo API.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/LICENSE DELETED
@@ -1,177 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/README.md DELETED
@@ -1,254 +0,0 @@
1
- # <img src="https://user-images.githubusercontent.com/33762/33720344-abc20bb8-db31-11e7-8362-59a4985aeff0.png" width="250" />
2
-
3
- [![Packagist](https://img.shields.io/packagist/v/vimeo/vimeo-api.svg?style=flat-square)](https://packagist.org/packages/vimeo/vimeo-api)
4
- [![License](https://img.shields.io/packagist/l/vimeo/vimeo-api.svg?style=flat-square)](https://packagist.org/packages/vimeo/vimeo-api)
5
- [![Travis CI](https://img.shields.io/travis/vimeo/vimeo.php.svg?style=flat-square)](https://travis-ci.org/vimeo/vimeo.php)
6
- [![StyleCI](https://styleci.io/repos/9654006/shield?style=flat-square)](https://styleci.io/repos/9654006/)
7
-
8
- This is a simple PHP library for interacting with the [Vimeo API](https://developers.vimeo.com).
9
-
10
- - [Get Started](#get-started-with-the-vimeo-api)
11
- - [Help](#direct-help)
12
- - [Troubleshooting](#troubleshooting)
13
- - [Installation](#installation)
14
- - [Usage](#usage)
15
- - [Authentication / Access Tokens](#generate-your-access-token)
16
- - [Unauthenticated tokens](#unauthenticated)
17
- - [Authenticated tokens](#authenticated)
18
- - [Make requests](#make-requests)
19
- - [Uploading videos](#uploading-videos)
20
- - [Upload videos from a server](#upload-videos-from-the-server)
21
- - [Replace videos from a server](#replace-videos-from-the-server)
22
- - [Client side uploads](#upload-or-replace-videos-from-the-client)
23
- - [Upload videos from a URL](#upload-videos-from-a-url)
24
- - [Upload images](#upload-images)
25
- - [Framework integrations](#framework-integrations)
26
-
27
- ## Get started with the Vimeo API
28
-
29
- There is a lot of information about the Vimeo API at <https://developer.vimeo.com/api/start>. Most of your questions will be answered there!
30
-
31
- ## Direct Help
32
-
33
- * [Stack Overflow](http://stackoverflow.com/questions/tagged/vimeo-api)
34
- * [Google Group](https://groups.google.com/forum/#!forum/vimeo-api)
35
- * [Vimeo Support](https://vimeo.com/help/contact)
36
-
37
- #### NOTE: How to use the PHP library with Vimeo dot notation documentation.
38
-
39
- The API docs often uses dot notation to represent a hierarchy of data (eg. privacy.view). Because this library sends all data using JSON, you must use nested associative arrays, not dot notation.
40
-
41
- ```php
42
- // The documentation refers to the following as `privacy.view`
43
- $params = ['privacy' => ['view' => 'disable']];
44
- ```
45
-
46
- ## Installation
47
- ### Composer
48
-
49
- 1. Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.
50
-
51
- ```bash
52
- composer require vimeo/vimeo-api
53
- ```
54
-
55
- 2. Use the library `$lib = new \Vimeo\Vimeo($client_id, $client_secret)`
56
-
57
- ### Manual
58
-
59
- 1. Download the latest release : [v2.0.0](https://github.com/vimeo/vimeo.php/archive/2.0.0.zip)
60
- 2. Include the autoloader `require("/path/to/vimeo.php/autoload.php");`
61
- 3. Use the library `$lib = new \Vimeo\Vimeo($client_id, $client_secret)`
62
-
63
- ## Usage
64
- ### Generate your access token
65
-
66
- All requests require access tokens. There are two types of access tokens.
67
-
68
- - [Unauthenticated](#unauthenticated) - Access tokens without a user. These tokens can only view public data
69
- - [Authenticated](#authenticated) - Access tokens with a user. These tokens interact on behalf of the authenticated user.
70
-
71
- #### Unauthenticated
72
-
73
- Unauthenticated API requests must generate an access token. You should not generate a new access token for each request, you should request an access token once and use it forever.
74
-
75
- ```php
76
- // `scope` is an array of permissions your token needs to access.
77
- // You can read more at https://developer.vimeo.com/api/authentication#supported-scopes
78
- $token = $lib->clientCredentials(scope);
79
-
80
- // usable access token
81
- var_dump($token['body']['access_token']);
82
-
83
- // accepted scopes
84
- var_dump($token['body']['scope']);
85
-
86
- // use the token
87
- $lib->setToken($token['body']['access_token']);
88
- ```
89
-
90
- #### Authenticated
91
-
92
- 1. Build a link to Vimeo so your users can authorize your app.
93
-
94
- ```php
95
- $url = $lib->buildAuthorizationEndpoint($redirect_uri, $scopes, $state)
96
- ```
97
-
98
- Name | Type | Description
99
- ---------------|----------|------------
100
- `redirect_uri` | string | The uri the user is redirected to in step 3. This value must be provided to every step of the authorization process including creating your app, building your authorization endpoint and exchanging your authorization code for an access token.
101
- `scope` | array | An array of permissions your token needs to access. You can read more at https://developer.vimeo.com/api/authentication#supported-scopes.
102
- `state` | string | A value unique to this authorization request. You should generate it randomly, and validate it in step 3.
103
-
104
- 2. Your user will need to access the authorization endpoint (either by clicking the link or through a redirect). On the authorization endpoint the user will have the option to deny your app any scopes you have requested. If they deny your app, they will be redirected back to your `redirect_url` with an `error` parameter.
105
-
106
- 3. If the user accepts your app, they will be redirected back to your `redirect_uri` with a `code` and `state` query parameter (eg. http://yourredirect.com?code=abc&state=xyz).
107
- 1. You must validate that the `state` matches your state from step 1.
108
- 2. If the state is valid, you can exchange your code and `redirect_uri` for an access token.
109
-
110
- ```php
111
- // `redirect_uri` must be provided, and must match your configured URI
112
- $token = $lib->accessToken(code, redirect_uri);
113
-
114
- // Usable access token
115
- var_dump($token['body']['access_token']);
116
-
117
- // Accepted scopes
118
- var_dump($token['body']['scope']);
119
-
120
- // Set the token
121
- $lib->setToken($token['body']['access_token']);
122
- ```
123
-
124
- For additional information, check out the [example](https://github.com/vimeo/vimeo.php/blob/master/example/auth.php)
125
-
126
- ### Make requests
127
-
128
- The API library has a `request` method which takes three parameters. It returns an associative array containing all of the relvant request information.
129
-
130
- #### Usage
131
-
132
- Name | Type | Description
133
- ----------|----------|------------
134
- `url` | string | The URL path (e.g.: `/users/dashron`).
135
- `params` | string | An object containing all of your parameters (e.g.: `{ "per_page": 5, "filter" : "featured"}` ).
136
- `method` | string | The HTTP method (e.g.: `GET`).
137
-
138
- ```php
139
- $response = $lib->request('/me/videos', ['per_page' => 2], 'GET');
140
- ```
141
-
142
- #### Response
143
-
144
- The response array will contain three keys.
145
-
146
- Name | Type | Description
147
- -----------|--------|------------
148
- `body` | array | The parsed request body. All responses are JSON so we parse this for you, and give you the result.
149
- `status` | number | The HTTP status code of the response. This partially informs you about the success of your API request.
150
- `headers` | array | An associative array containing all of the response headers.
151
-
152
- ```php
153
- $response = $lib->request('/me/videos', ['per_page' => 2], 'GET');
154
- var_dump($response['body']);
155
- ```
156
-
157
- ### Uploading videos
158
- #### Upload videos from the server
159
-
160
- To upload videos you must call the `upload` method. It accepts two parameters. It will return the URI of the new video.
161
-
162
- Internally, this library will execute a `tus` upload approach and send a file to the server with the [tus](https://tus.io/) upload protocol.
163
-
164
- For more information check out the [example](https://github.com/vimeo/vimeo.php/blob/master/example/upload.php)
165
-
166
- Name | Type | Description
167
- ---------|---------|------------
168
- `file` | string | Full path to the upload file on the local system.
169
- `params` | array | Parameters to send when creating a new video (name, privacy restrictions, etc.). See the [`/me/videos` documentation](https://developer.vimeo.com/api/endpoints/videos#POST/users/{user_id}/videos) for supported parameters.
170
-
171
- ```php
172
- $response = $lib->upload('/home/aaron/Downloads/ada.mp4')
173
-
174
- // With parameters.
175
- $response = $lib->upload('/home/aaron/Downloads/ada.mp4', [
176
- 'name' => 'Ada',
177
- 'privacy' => [
178
- 'view' => 'anybody'
179
- ]
180
- ])
181
- ```
182
-
183
- #### Replace videos from the server
184
-
185
- To replace the source file of a video, you must call the `replace` method. It accepts two parameters. It will return the URI of the replaced video.
186
-
187
- Name | Type | Description
188
- ------------|----------|------------
189
- `video_uri` | string | The URI of the original video. Once uploaded and successfully transcoded your source video file will be swapped with this new video file.
190
- `file` | string | Full path to the upload file on the local system.
191
-
192
- ```php
193
- $response = $lib->replace('/videos/12345', '/home/aaron/Downloads/ada-v2.mp4')
194
- ```
195
-
196
- #### Upload or replace videos from the client
197
-
198
- To upload from the client, you will have to mix some server side, and client side API requests. We support two workflows, the first of which is much easier than the second.
199
-
200
- ##### Simple POST uploads
201
-
202
- This workflow is well documented on Vimeo's developer site. You can read more here: <https://developer.vimeo.com/api/upload/videos#simple-upload>
203
-
204
- ##### Streaming uploads
205
-
206
- Streaming uploads support progress bars, and resumable uploading. If you want to perform these uploads client side you will need to start with some server side requests.
207
-
208
- Read through the [Vimeo documentation](https://developer.vimeo.com/api/upload/videos#resumable-upload) first. Step 1 and 4 should be performed on the server, while step 2 and 3 can be performed on the client. With this workflow the video will never be transferred to your servers.
209
-
210
- #### Upload videos from a url
211
-
212
- Uploading videos from a public url (also called "pull uploads") uses a single, simple API call.
213
-
214
- ```php
215
- $video_response = $lib->request(
216
- '/me/videos',
217
- [
218
- 'upload' => ['approach' => 'pull'],
219
- 'link' => $url
220
- ],
221
- 'POST'
222
- );
223
- ```
224
-
225
- ### Upload images
226
-
227
- To upload an image, call the `uploadImage` method. It takes three parameters.
228
-
229
- For more information check out the [example](https://github.com/vimeo/vimeo.php/blob/master/example/upload_image.php)
230
-
231
- Name | Type | Description
232
- ---------------|----------|------------
233
- `pictures_uri` | string | The URI to the pictures collection for a single resource. eg. `/videos/12345/pictures`. You can always find this in the resource representation.
234
- `file` | string | Full path to the upload file on the local system.
235
- `activate` | boolean | (Optional) Defaults to `false`. If true this picture will become the default picture for the associated resource.
236
-
237
- ```php
238
- $response = $lib->uploadImage('/videos/12345/pictures', '/home/aaron/Downloads/ada.png', true)
239
- ```
240
-
241
- ## Troubleshooting
242
-
243
- If you have any questions or problems, create a [ticket](https://github.com/vimeo/vimeo.php/issues) or [contact us](https://vimeo.com/help/contact)
244
-
245
- ## Framework integrations
246
-
247
- - **WordPress** - <http://vimeography.com/>
248
- - **Laravel** - <https://github.com/vinkla/vimeo>
249
-
250
- If you have integrated Vimeo into a popular PHP framework let us know!
251
-
252
- ## Contributors
253
-
254
- To see the contributors please visit the [contributors graph](https://github.com/vimeo/vimeo.php/graphs/contributors).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/autoload.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright 2014 Vimeo
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
- spl_autoload_register(function ($class) {
19
- // Make sure that the class being loaded is in the vimeo namespace
20
- if (substr(strtolower($class), 0, 6) !== 'vimeo\\') {
21
- return;
22
- }
23
-
24
- // Locate and load the file that contains the class
25
- $path = __DIR__ . '/src/' . str_replace('\\', '/', $class) . '.php';
26
- if (file_exists($path)) {
27
- require($path);
28
- }
29
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/certificates/vimeo-api.pem DELETED
@@ -1,47 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIElDCCA3ygAwIBAgIQAf2j627KdciIQ4tyS8+8kTANBgkqhkiG9w0BAQsFADBh
3
- MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
4
- d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
5
- QTAeFw0xMzAzMDgxMjAwMDBaFw0yMzAzMDgxMjAwMDBaME0xCzAJBgNVBAYTAlVT
6
- MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxJzAlBgNVBAMTHkRpZ2lDZXJ0IFNIQTIg
7
- U2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
8
- ANyuWJBNwcQwFZA1W248ghX1LFy949v/cUP6ZCWA1O4Yok3wZtAKc24RmDYXZK83
9
- nf36QYSvx6+M/hpzTc8zl5CilodTgyu5pnVILR1WN3vaMTIa16yrBvSqXUu3R0bd
10
- KpPDkC55gIDvEwRqFDu1m5K+wgdlTvza/P96rtxcflUxDOg5B6TXvi/TC2rSsd9f
11
- /ld0Uzs1gN2ujkSYs58O09rg1/RrKatEp0tYhG2SS4HD2nOLEpdIkARFdRrdNzGX
12
- kujNVA075ME/OV4uuPNcfhCOhkEAjUVmR7ChZc6gqikJTvOX6+guqw9ypzAO+sf0
13
- /RR3w6RbKFfCs/mC/bdFWJsCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8C
14
- AQAwDgYDVR0PAQH/BAQDAgGGMDQGCCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYY
15
- aHR0cDovL29jc3AuZGlnaWNlcnQuY29tMHsGA1UdHwR0MHIwN6A1oDOGMWh0dHA6
16
- Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RDQS5jcmwwN6A1
17
- oDOGMWh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RD
18
- QS5jcmwwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8v
19
- d3d3LmRpZ2ljZXJ0LmNvbS9DUFMwHQYDVR0OBBYEFA+AYRyCMWHVLyjnjUY4tCzh
20
- xtniMB8GA1UdIwQYMBaAFAPeUDVW0Uy7ZvCj4hsbw5eyPdFVMA0GCSqGSIb3DQEB
21
- CwUAA4IBAQAjPt9L0jFCpbZ+QlwaRMxp0Wi0XUvgBCFsS+JtzLHgl4+mUwnNqipl
22
- 5TlPHoOlblyYoiQm5vuh7ZPHLgLGTUq/sELfeNqzqPlt/yGFUzZgTHbO7Djc1lGA
23
- 8MXW5dRNJ2Srm8c+cftIl7gzbckTB+6WohsYFfZcTEDts8Ls/3HB40f/1LkAtDdC
24
- 2iDJ6m6K7hQGrn2iWZiIqBtvLfTyyRRfJs8sjX7tN8Cp1Tm5gr8ZDOo0rwAhaPit
25
- c+LJMto4JQtV05od8GiG7S5BNO98pVAdvzr508EIDObtHopYJeS4d60tbvVS3bR0
26
- j6tJLp07kzQoH3jOlOrHvdPJbRzeXDLz
27
- -----END CERTIFICATE-----
28
-
29
- -----BEGIN CERTIFICATE-----
30
- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG
31
- EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
32
- HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw
33
- MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
34
- dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq
35
- hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn
36
- TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5
37
- BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H
38
- 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y
39
- 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB
40
- o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm
41
- 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF
42
- BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr
43
- EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt
44
- tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886
45
- UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
46
- CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
47
- -----END CERTIFICATE-----
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/composer.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "name": "vimeo/vimeo-api",
3
- "description": "Official PHP library for the Vimeo API.",
4
- "homepage": "https://github.com/vimeo/vimeo.php",
5
- "keywords": ["vimeo", "video"],
6
- "license": "Apache-2.0",
7
- "authors": [
8
- {
9
- "name": "Vimeo",
10
- "homepage": "http://vimeo.com"
11
- }
12
- ],
13
- "minimum-stability": "stable",
14
- "require": {
15
- "php": ">=5.3.0",
16
- "ext-curl": "*",
17
- "ext-json":"*"
18
- },
19
- "autoload": {
20
- "psr-4": {
21
- "Vimeo\\": "src/Vimeo"
22
- }
23
- },
24
- "require-dev": {
25
- "phpunit/phpunit": "^4.8"
26
- },
27
- "scripts": {
28
- "coverage": "phpunit --coverage-html reports/",
29
- "tests": "phpunit"
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/phpunit.xml DELETED
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit backupGlobals="false"
3
- backupStaticAttributes="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- processIsolation="false"
9
- stopOnFailure="false"
10
- syntaxCheck="false">
11
- <testsuites>
12
- <testsuite name="Vimeo PHP SDK">
13
- <directory>./tests/</directory>
14
- </testsuite>
15
- </testsuites>
16
-
17
- <filter>
18
- <whitelist>
19
- <directory>src/</directory>
20
- </whitelist>
21
- </filter>
22
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/src/Vimeo/Exceptions/ExceptionInterface.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Vimeo\Exceptions;
3
-
4
- /**
5
- * ExceptionInterface
6
- */
7
- interface ExceptionInterface
8
- {
9
- }
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/src/Vimeo/Exceptions/VimeoRequestException.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Vimeo\Exceptions;
3
-
4
- /**
5
- * VimeoRequestException class for failure to make request.
6
- */
7
- class VimeoRequestException extends \Exception implements ExceptionInterface
8
- {
9
- }
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/src/Vimeo/Exceptions/VimeoUploadException.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Vimeo\Exceptions;
3
-
4
- /**
5
- * VimeoUploadException class for failure to upload to the server.
6
- */
7
- class VimeoUploadException extends \Exception implements ExceptionInterface
8
- {
9
- }
 
 
 
 
 
 
 
 
 
vendor/vimeo/vimeo-api/src/Vimeo/Vimeo.php DELETED
@@ -1,598 +0,0 @@
1
- <?php
2
- namespace Vimeo;
3
-
4
- use Vimeo\Exceptions\VimeoRequestException;
5
- use Vimeo\Exceptions\VimeoUploadException;
6
-
7
- /**
8
- * Copyright 2013 Vimeo
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
-
23
- if (!function_exists('json_decode')) {
24
- throw new \Exception('We could not find json_decode. json_decode is found in php 5.2 and up, but may be missing on some Linux systems due to licensing conflicts. If you are running ubuntu try "sudo apt-get install php5-json".');
25
- }
26
-
27
- class Vimeo
28
- {
29
- const ROOT_ENDPOINT = 'https://api.vimeo.com';
30
- const AUTH_ENDPOINT = 'https://api.vimeo.com/oauth/authorize';
31
- const ACCESS_TOKEN_ENDPOINT = '/oauth/access_token';
32
- const CLIENT_CREDENTIALS_TOKEN_ENDPOINT = '/oauth/authorize/client';
33
- const VERSIONS_ENDPOINT = '/versions';
34
- const VERSION_STRING = 'application/vnd.vimeo.*+json; version=3.4';
35
- const USER_AGENT = 'vimeo.php 2.0.0; (http://developer.vimeo.com/api/docs)';
36
- const CERTIFICATE_PATH = '/certificates/vimeo-api.pem';
37
-
38
- protected $_curl_opts = array();
39
- protected $CURL_DEFAULTS = array();
40
-
41
- private $_client_id = null;
42
- private $_client_secret = null;
43
- private $_access_token = null;
44
-
45
- /**
46
- * Creates the Vimeo library, and tracks the client and token information.
47
- *
48
- * @param string $client_id Your applications client id. Can be found on developer.vimeo.com/apps
49
- * @param string $client_secret Your applications client secret. Can be found on developer.vimeo.com/apps
50
- * @param string $access_token Your applications client id. Can be found on developer.vimeo.com/apps or generated using OAuth 2.
51
- */
52
- public function __construct($client_id, $client_secret, $access_token = null)
53
- {
54
- $this->_client_id = $client_id;
55
- $this->_client_secret = $client_secret;
56
- $this->_access_token = $access_token;
57
- $this->CURL_DEFAULTS = array(
58
- CURLOPT_HEADER => 1,
59
- CURLOPT_RETURNTRANSFER => true,
60
- CURLOPT_TIMEOUT => 30,
61
- CURLOPT_SSL_VERIFYPEER => true,
62
- //Certificate must indicate that the server is the server to which you meant to connect.
63
- CURLOPT_SSL_VERIFYHOST => 2,
64
- CURLOPT_CAINFO => realpath(__DIR__ .'/../..') . self::CERTIFICATE_PATH
65
- );
66
- }
67
-
68
- /**
69
- * Make an API request to Vimeo.
70
- *
71
- * @param string $url A Vimeo API Endpoint. Should not include the host
72
- * @param array $params An array of parameters to send to the endpoint. If the HTTP method is GET, they will be added to the url, otherwise they will be written to the body
73
- * @param string $method The HTTP Method of the request
74
- * @param bool $json_body
75
- * @param array $headers An array of HTTP headers to pass along with the request.
76
- * @return array This array contains three keys, 'status' is the status code, 'body' is an object representation of the json response body, and headers are an associated array of response headers
77
- */
78
- public function request($url, $params = array(), $method = 'GET', $json_body = true, array $headers = array())
79
- {
80
- $headers = array_merge(array(
81
- 'Accept' => self::VERSION_STRING,
82
- 'User-Agent' => self::USER_AGENT,
83
- ), $headers);
84
-
85
- $method = strtoupper($method);
86
-
87
- // add bearer token, or client information
88
- if (!empty($this->_access_token)) {
89
- $headers['Authorization'] = 'Bearer ' . $this->_access_token;
90
- } else {
91
- // this may be a call to get the tokens, so we add the client info.
92
- $headers['Authorization'] = 'Basic ' . $this->_authHeader();
93
- }
94
-
95
- // Set the methods, determine the URL that we should actually request and prep the body.
96
- $curl_opts = array();
97
- switch ($method) {
98
- case 'GET':
99
- if (!empty($params)) {
100
- $query_component = '?' . http_build_query($params, '', '&');
101
- } else {
102
- $query_component = '';
103
- }
104
-
105
- $curl_url = self::ROOT_ENDPOINT . $url . $query_component;
106
- break;
107
-
108
- case 'POST':
109
- case 'PATCH':
110
- case 'PUT':
111
- case 'DELETE':
112
- if ($json_body && !empty($params)) {
113
- $headers['Content-Type'] = 'application/json';
114
- $body = json_encode($params);
115
- } else {
116
- $body = http_build_query($params, '', '&');
117
- }
118
-
119
- $curl_url = self::ROOT_ENDPOINT . $url;
120
- $curl_opts = array(
121
- CURLOPT_POST => true,
122
- CURLOPT_CUSTOMREQUEST => $method,
123
- CURLOPT_POSTFIELDS => $body
124
- );
125
- break;
126
- }
127
-
128
- // Set the headers
129
- foreach ($headers as $key => $value) {
130
- $curl_opts[CURLOPT_HTTPHEADER][] = sprintf('%s: %s', $key, $value);
131
- }
132
-
133
- $response = $this->_request($curl_url, $curl_opts);
134
-
135
- $response['body'] = json_decode($response['body'], true);
136
-
137
- return $response;
138
- }
139
-
140
- /**
141
- * Request the access token associated with this library.
142
- *
143
- * @return string
144
- */
145
- public function getToken()
146
- {
147
- return $this->_access_token;
148
- }
149
-
150
- /**
151
- * Assign a new access token to this library.
152
- *
153
- * @param string $access_token the new access token
154
- */
155
- public function setToken($access_token)
156
- {
157
- $this->_access_token = $access_token;
158
- }
159
-
160
- /**
161
- * Sets custom cURL options.
162
- *
163
- * @param array $curl_opts An associative array of cURL options.
164
- */
165
- public function setCURLOptions($curl_opts = array())
166
- {
167
- $this->_curl_opts = $curl_opts;
168
- }
169
-
170
- /**
171
- * Convert the raw headers string into an associated array
172
- *
173
- * @param string $headers
174
- * @return array
175
- */
176
- public static function parse_headers($headers)
177
- {
178
- $final_headers = array();
179
- $list = explode("\n", trim($headers));
180
-
181
- $http = array_shift($list);
182
-
183
- foreach ($list as $header) {
184
- $parts = explode(':', $header, 2);
185
- $final_headers[trim($parts[0])] = isset($parts[1]) ? trim($parts[1]) : '';
186
- }
187
-
188
- return $final_headers;
189
- }
190
-
191
- /**
192
- * Request an access token. This is the final step of the
193
- * OAuth 2 workflow, and should be called from your redirect url.
194
- *
195
- * @param string $code The authorization code that was provided to your redirect url
196
- * @param string $redirect_uri The redirect_uri that is configured on your app page, and was used in buildAuthorizationEndpoint
197
- * @return array This array contains three keys, 'status' is the status code, 'body' is an object representation of the json response body, and headers are an associated array of response headers
198
- */
199
- public function accessToken($code, $redirect_uri)
200
- {
201
- return $this->request(self::ACCESS_TOKEN_ENDPOINT, array(
202
- 'grant_type' => 'authorization_code',
203
- 'code' => $code,
204
- 'redirect_uri' => $redirect_uri
205
- ), "POST", false);
206
- }
207
-
208
- /**
209
- * Get client credentials for requests.
210
- *
211
- * @param mixed $scope Scopes to request for this token from the server.
212
- * @return array Response from the server with the tokens, we also set it into this object.
213
- */
214
- public function clientCredentials($scope = 'public')
215
- {
216
- if (is_array($scope)) {
217
- $scope = implode(' ', $scope);
218
- }
219
-
220
- $token_response = $this->request(self::CLIENT_CREDENTIALS_TOKEN_ENDPOINT, array(
221
- 'grant_type' => 'client_credentials',
222
- 'scope' => $scope
223
- ), "POST", false);
224
-
225
- return $token_response;
226
- }
227
-
228
- /**
229
- * Build the url that your user.
230
- *
231
- * @param string $redirect_uri The redirect url that you have configured on your app page
232
- * @param string $scope An array of scopes that your final access token needs to access
233
- * @param string $state A random variable that will be returned on your redirect url. You should validate that this matches
234
- * @return string
235
- */
236
- public function buildAuthorizationEndpoint($redirect_uri, $scope = 'public', $state = null)
237
- {
238
- $query = array(
239
- "response_type" => 'code',
240
- "client_id" => $this->_client_id,
241
- "redirect_uri" => $redirect_uri
242
- );
243
-
244
- $query['scope'] = $scope;
245
- if (empty($scope)) {
246
- $query['scope'] = 'public';
247
- } elseif (is_array($scope)) {
248
- $query['scope'] = implode(' ', $scope);
249
- }
250
-
251
- if (!empty($state)) {
252
- $query['state'] = $state;
253
- }
254
-
255
- return self::AUTH_ENDPOINT . '?' . http_build_query($query);
256
- }
257
-
258
- /**
259
- * Upload a file.
260
- *
261
- * This should be used to upload a local file. If you want a form for your site to upload direct to Vimeo, you
262
- * should look at the `POST /me/videos` endpoint.
263
- *
264
- * @link https://developer.vimeo.com/api/endpoints/videos#POST/users/{user_id}/videos
265
- * @param string $file_path Path to the video file to upload.
266
- * @param array $params Parameters to send when creating a new video (name, privacy restrictions, etc.).
267
- * @throws VimeoUploadException
268
- * @return string Video URI
269
- */
270
- public function upload($file_path, array $params = array())
271
- {
272
- // Validate that our file is real.
273
- if (!is_file($file_path)) {
274
- throw new VimeoUploadException('Unable to locate file to upload.');
275
- }
276
-
277
- $file_size = filesize($file_path);
278
-
279
- // If the user does not have enough free space in their quota to upload this, then don't.
280
- $response = $this->request('/me', array('fields' => 'upload_quota.space.free'), 'GET');
281
- if ($response['status'] !== 200) {
282
- $error = !empty($response['body']['error']) ? ' [' . $response['body']['error'] . ']' : '';
283
- throw new VimeoUploadException('Unable to pull the users upload quota.' . $error);
284
- } elseif ($file_size > $response['body']['upload_quota']['space']['free']) {
285
- throw new VimeoUploadException('User does not have any more free space to upload this video.');
286
- }
287
-
288
- // Ignore any specified upload approach and size.
289
- $params['upload']['approach'] = 'tus';
290
- $params['upload']['size'] = $file_size;
291
-
292
- // Use JSON filtering so we only receive the data that we need to make an upload happen.
293
- $uri = '/me/videos?fields=uri,upload';
294
-
295
- $attempt = $this->request($uri, $params, 'POST');
296
- if ($attempt['status'] !== 200) {
297
- $attempt_error = !empty($attempt['body']['error']) ? ' [' . $attempt['body']['error'] . ']' : '';
298
- throw new VimeoUploadException('Unable to initiate an upload.' . $attempt_error);
299
- }
300
-
301
- return $this->perform_upload_tus($file_path, $file_size, $attempt);
302
- }
303
-
304
- /**
305
- * Replace the source of a single Vimeo video.
306
- *
307
- * @link https://developer.vimeo.com/api/endpoints/videos#POST/videos/{video_id}/versions
308
- * @param string $video_uri Video uri of the video file to replace.
309
- * @param string $file_path Path to the video file to upload.
310
- * @throws VimeoUploadException
311
- * @return string Video URI
312
- */
313
- public function replace($video_uri, $file_path, array $params = array())
314
- {
315
- // Validate that our file is real.
316
- if (!is_file($file_path)) {
317
- throw new VimeoUploadException('Unable to locate file to upload.');
318
- }
319
-
320
- $file_size = filesize($file_path);
321
-
322
- // Use JSON filtering so we only receive the data that we need to make an upload happen.
323
- $uri = $video_uri . self::VERSIONS_ENDPOINT . '?fields=upload';
324
-
325
- // Ignore any specified upload approach and size.
326
- $params['file_name'] = basename($file_path);
327
- $params['upload']['approach'] = 'tus';
328
- $params['upload']['size'] = $file_size;
329
-
330
- $attempt = $this->request($uri, $params, 'POST');
331
- if ($attempt['status'] !== 201) {
332
- $attempt_error = !empty($attempt['body']['error']) ? ' [' . $attempt['body']['error'] . ']' : '';
333
- throw new VimeoUploadException('Unable to initiate an upload.' . $attempt_error);
334
- }
335
-
336
- // `uri` doesn't come back from `/videos/:id/versions` so we need to manually set it here for uploading.
337
- $attempt['body']['uri'] = $video_uri;
338
-
339
- return $this->perform_upload_tus($file_path, $file_size, $attempt);
340
- }
341
-
342
- /**
343
- * Uploads an image to an individual picture response.
344
- *
345
- * @link https://developer.vimeo.com/api/upload/pictures
346
- * @param string $pictures_uri The pictures endpoint for a resource that allows picture uploads (eg videos and users)
347
- * @param string $file_path The path to your image file
348
- * @param boolean $activate Activate image after upload
349
- * @throws VimeoUploadException
350
- * @return string The URI of the uploaded image.
351
- */
352
- public function uploadImage($pictures_uri, $file_path, $activate = false)
353
- {
354
- // Validate that our file is real.
355
- if (!is_file($file_path)) {
356
- throw new VimeoUploadException('Unable to locate file to upload.');
357
- }
358
-
359
- $pictures_response = $this->request($pictures_uri, array(), 'POST');
360
- if ($pictures_response['status'] !== 201) {
361
- throw new VimeoUploadException('Unable to request an upload url from vimeo');
362
- }
363
-
364
- $upload_url = $pictures_response['body']['link'];
365
-
366
- $image_resource = fopen($file_path, 'r');
367
-
368
- $curl_opts = array(
369
- CURLOPT_TIMEOUT => 240,
370
- CURLOPT_UPLOAD => true,
371
- CURLOPT_CUSTOMREQUEST => 'PUT',
372
- CURLOPT_READDATA => $image_resource
373
- );
374
-
375
- $curl = curl_init($upload_url);
376
-
377
- // Merge the options
378
- curl_setopt_array($curl, $curl_opts + $this->CURL_DEFAULTS);
379
- $response = curl_exec($curl);
380
- $curl_info = curl_getinfo($curl);
381
-
382
- if (!$response) {
383
- $error = curl_error($curl);
384
- throw new VimeoUploadException($error);
385
- }
386
- curl_close($curl);
387
-
388
- if ($curl_info['http_code'] !== 200) {
389
- throw new VimeoUploadException($response);
390
- }
391
-
392
- // Activate the uploaded image
393
- if ($activate) {
394
- $completion = $this->request($pictures_response['body']['uri'], array('active' => true), 'PATCH');
395
- }
396
-
397
- return $pictures_response['body']['uri'];
398
- }
399
-
400
- /**
401
- * Uploads a text track.
402
- *
403
- * @link https://developer.vimeo.com/api/upload/texttracks
404
- * @param string $texttracks_uri The text tracks uri that we are adding our text track to
405
- * @param string $file_path The path to your text track file
406
- * @param string $track_type The type of your text track
407
- * @param string $language The language of your text track
408
- * @throws VimeoUploadException
409
- * @return string The URI of the uploaded text track.
410
- */
411
- public function uploadTexttrack($texttracks_uri, $file_path, $track_type, $language)
412
- {
413
- // Validate that our file is real.
414
- if (!is_file($file_path)) {
415
- throw new VimeoUploadException('Unable to locate file to upload.');
416
- }
417
-
418
- // To simplify the script we provide the filename as the text track name, but you can provide any value you want.
419
- $name = array_slice(explode("/", $file_path), -1);
420
- $name = $name[0];
421
-
422
- $texttrack_response = $this->request($texttracks_uri, array('type' => $track_type, 'language' => $language, 'name' => $name), 'POST');
423
-
424
- if ($texttrack_response['status'] !== 201) {
425
- throw new VimeoUploadException('Unable to request an upload url from vimeo');
426
- }
427
-
428
- $upload_url = $texttrack_response['body']['link'];
429
-
430
- $texttrack_resource = fopen($file_path, 'r');
431
-
432
- $curl_opts = array(
433
- CURLOPT_TIMEOUT => 240,
434
- CURLOPT_UPLOAD => true,
435
- CURLOPT_CUSTOMREQUEST => 'PUT',
436
- CURLOPT_READDATA => $texttrack_resource
437
- );
438
-
439
- $curl = curl_init($upload_url);
440
-
441
- // Merge the options
442
- curl_setopt_array($curl, $curl_opts + $this->CURL_DEFAULTS);
443
- $response = curl_exec($curl);
444
- $curl_info = curl_getinfo($curl);
445
-
446
- if (!$response) {
447
- $error = curl_error($curl);
448
- throw new VimeoUploadException($error);
449
- }
450
- curl_close($curl);
451
-
452
- if ($curl_info['http_code'] !== 200) {
453
- throw new VimeoUploadException($response);
454
- }
455
-
456
- return $texttrack_response['body']['uri'];
457
- }
458
-
459
- /**
460
- * Internal function to handle requests, both authenticated and by the upload function.
461
- *
462
- * @param string $url
463
- * @param array $curl_opts
464
- * @return array
465
- */
466
- private function _request($url, $curl_opts = array())
467
- {
468
- // Merge the options (custom options take precedence).
469
- $curl_opts = $this->_curl_opts + $curl_opts + $this->CURL_DEFAULTS;
470
-
471
- // Call the API.
472
- $curl = curl_init($url);
473
- curl_setopt_array($curl, $curl_opts);
474
- $response = curl_exec($curl);
475
- $curl_info = curl_getinfo($curl);
476
-
477
- if (isset($curl_info['http_code']) && $curl_info['http_code'] === 0) {
478
- $curl_error = curl_error($curl);
479
- $curl_error = !empty($curl_error) ? ' [' . $curl_error .']' : '';
480
- throw new VimeoRequestException('Unable to complete request.' . $curl_error);
481
- }
482
-
483
- curl_close($curl);
484
-
485
- // Retrieve the info
486
- $header_size = $curl_info['header_size'];
487
- $headers = substr($response, 0, $header_size);
488
- $body = substr($response, $header_size);
489
-
490
- // Return it raw.
491
- return array(
492
- 'body' => $body,
493
- 'status' => $curl_info['http_code'],
494
- 'headers' => self::parse_headers($headers)
495
- );
496
- }
497
-
498
- /**
499
- * Get authorization header for retrieving tokens/credentials.
500
- *
501
- * @return string
502
- */
503
- private function _authHeader()
504
- {
505
- return base64_encode($this->_client_id . ':' . $this->_client_secret);
506
- }
507
-
508
- /**
509
- * Take an upload attempt and perform the actual upload via tus.
510
- *
511
- * @link https://tus.io/
512
- * @param string $file_path Path to the video file to upload
513
- * @param int $file_size Size of the video file.
514
- * @param array $attempt Upload attempt data.
515
- * @return mixed
516
- * @throws VimeoRequestException
517
- * @throws VimeoUploadException
518
- */
519
- private function perform_upload_tus($file_path, $file_size, $attempt)
520
- {
521
- $url = $attempt['body']['upload']['upload_link'];
522
-
523
- // We need a handle on the input file since we may have to send segments multiple times.
524
- $file = fopen($file_path, 'r');
525
-
526
- $curl_opts = array(
527
- CURLOPT_POST => true,
528
- CURLOPT_CUSTOMREQUEST => 'PATCH',
529
- CURLOPT_INFILE => $file,
530
- CURLOPT_INFILESIZE => filesize($file_path),
531
- CURLOPT_UPLOAD => true,
532
- CURLOPT_HTTPHEADER => array(
533
- 'Expect: ',
534
- 'Content-Type: application/offset+octet-stream',
535
- 'Tus-Resumable: 1.0.0',
536
- 'Upload-Offset: {placeholder}',
537
- )
538
- );
539
-
540
- // Perform the upload by sending as much to the server as possible and ending when we reach the file size on
541
- // the server.
542
- $failures = 0;
543
- $server_at = 0;
544
- do {
545
- // The last HTTP header we set has to be `Upload-Offset`, since for resumable uploading to work properly,
546
- // we'll need to alter the content of the header for each upload segment request.
547
- array_pop($curl_opts[CURLOPT_HTTPHEADER]);
548
- $curl_opts[CURLOPT_HTTPHEADER][] = 'Upload-Offset: ' . $server_at;
549
-
550
- fseek($file, $server_at);
551
-
552
- try {
553
- $response = $this->_request($url, $curl_opts);
554
-
555
- // Successful upload, so reset the failure counter.
556
- $failures = 0;
557
-
558
- if ($response['status'] === 204) {
559
- // If the `Upload-Offset` returned is equal to the size of the video we want to upload, then we've
560
- // fully uploaded the video. If not, continue uploading.
561
- if ($response['headers']['Upload-Offset'] === $file_size) {
562
- break;
563
- }
564
-
565
- $server_at = $response['headers']['Upload-Offset'];
566
- continue;
567
- }
568
-
569
- // If we didn't receive a 204 response from the tus server, then we should verify what's going on before
570
- // proceeding to upload more pieces.
571
- $verify_response = $this->request($url, array(), 'HEAD');
572
- if ($verify_response['status'] !== 200) {
573
- $verify_error = !empty($ticket['body']) ? ' [' . $ticket['body'] . ']' : '';
574
- throw new VimeoUploadException('Unable to verify upload' . $verify_error);
575
- }
576
-
577
- if ($verify_response['headers']['Upload-Offset'] === $file_size) {
578
- break;
579
- }
580
-
581
- $server_at = $verify_response['headers']['Upload-Offset'];
582
- } catch (VimeoRequestException $exception) {
583
- // We likely experienced a timeout, but if we experience three in a row, then we should back off and
584
- // fail so as to not overwhelm servers that are, probably, down.
585
- if ($failures >= 3) {
586
- throw $exception;
587
- }
588
-
589
- $failures++;
590
- sleep(pow(4, $failures)); // sleep 4, 16, 64 seconds (based on failure count)
591
- } catch (VimeoUploadException $exception) {
592
- throw $exception;
593
- }
594
- } while ($server_at < $file_size);
595
-
596
- return $attempt['body']['uri'];
597
- }
598
- }