Google Analytics for WordPress by MonsterInsights - Version 5.3.2

Version Description

Release Date: February 18th, 2015

  • Enhancements:

    • Throws away the GA data when a user changes his GA profile.
    • Makes a few strings translatable that were not translatable yet.
  • Bugfixes:

    • Fixes the "Missing class information" Zend error that was caused by our api-libs package.
Download this release

Release Info

Developer omarreiss
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 5.3.2
Comparing to
See all releases

Code changes from version 5.3.1 to 5.3.2

Files changed (168) hide show
  1. README.md +5 -3
  2. admin/api-libs/README.md +0 -2
  3. admin/api-libs/class-api-libs.php +0 -136
  4. admin/api-libs/google/class-api-google.php +0 -84
  5. admin/api-libs/googleanalytics/class-api-googleanalytics.php +0 -47
  6. admin/class-admin-form.php +5 -1
  7. admin/class-admin.php +72 -28
  8. admin/pages/extensions.php +3 -3
  9. admin/pages/settings.php +3 -3
  10. googleanalytics.php +4 -4
  11. includes/class-autoload.php +0 -73
  12. includes/class-options.php +1 -1
  13. readme.txt +12 -1
  14. vendor/autoload.php +7 -0
  15. vendor/autoload_52.php +7 -0
  16. vendor/composer/ClassLoader.php +413 -0
  17. vendor/composer/ClassLoader52.php +271 -0
  18. vendor/composer/autoload_classmap.php +44 -0
  19. vendor/composer/autoload_namespaces.php +11 -0
  20. vendor/composer/autoload_psr4.php +9 -0
  21. vendor/composer/autoload_real.php +50 -0
  22. vendor/composer/autoload_real_52.php +44 -0
  23. vendor/composer/installed.json +259 -0
  24. vendor/composer/installers/.editorconfig +10 -0
  25. vendor/composer/installers/.gitignore +3 -0
  26. vendor/composer/installers/.travis.yml +14 -0
  27. vendor/composer/installers/LICENSE +19 -0
  28. vendor/composer/installers/README.md +189 -0
  29. vendor/composer/installers/composer.json +76 -0
  30. vendor/composer/installers/phpunit.xml.dist +25 -0
  31. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +21 -0
  32. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +11 -0
  33. vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +45 -0
  34. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +131 -0
  35. vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +11 -0
  36. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +145 -0
  37. vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +11 -0
  38. vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +10 -0
  39. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +11 -0
  40. vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +12 -0
  41. vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +9 -0
  42. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +21 -0
  43. vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +50 -0
  44. vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +16 -0
  45. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +14 -0
  46. vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +9 -0
  47. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +11 -0
  48. vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +9 -0
  49. vendor/composer/installers/src/Composer/Installers/GravInstaller.php +30 -0
  50. vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +25 -0
  51. vendor/composer/installers/src/Composer/Installers/Installer.php +161 -0
  52. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +15 -0
  53. vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +9 -0
  54. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +9 -0
  55. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +9 -0
  56. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +10 -0
  57. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +9 -0
  58. vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +16 -0
  59. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +11 -0
  60. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +9 -0
  61. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +50 -0
  62. vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +111 -0
  63. vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +47 -0
  64. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +46 -0
  65. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +11 -0
  66. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +9 -0
  67. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +11 -0
  68. vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +21 -0
  69. vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +32 -0
  70. vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +11 -0
  71. vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +10 -0
  72. vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +22 -0
  73. vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +10 -0
  74. vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +58 -0
  75. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +36 -0
  76. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +26 -0
  77. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +14 -0
  78. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +38 -0
  79. vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +12 -0
  80. vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +14 -0
  81. vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +10 -0
  82. vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +9 -0
  83. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +11 -0
  84. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +11 -0
  85. vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +10 -0
  86. vendor/composer/installers/src/bootstrap.php +13 -0
  87. vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php +61 -0
  88. vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +163 -0
  89. vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php +89 -0
  90. vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php +63 -0
  91. vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +416 -0
  92. vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php +66 -0
  93. vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php +66 -0
  94. vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php +44 -0
  95. vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php +63 -0
  96. vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php +64 -0
  97. vendor/composer/installers/tests/bootstrap.php +4 -0
  98. vendor/xrstf/composer-php52/.hg_archival.txt +4 -0
  99. vendor/xrstf/composer-php52/.hgtags +17 -0
  100. vendor/xrstf/composer-php52/LICENSE +19 -0
  101. vendor/xrstf/composer-php52/README.md +29 -0
  102. vendor/xrstf/composer-php52/composer.json +27 -0
  103. vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php +324 -0
  104. vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php +271 -0
  105. vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php +44 -0
  106. vendor/yoast/api-libs/README.md +4 -0
  107. vendor/yoast/api-libs/class-api-libs.php +136 -0
  108. {admin → vendor/yoast}/api-libs/composer.json +1 -1
  109. {admin → vendor/yoast}/api-libs/google/Google_Client.php +0 -0
  110. {admin → vendor/yoast}/api-libs/google/auth/Google_AssertionCredentials.php +0 -0
  111. {admin → vendor/yoast}/api-libs/google/auth/Google_Auth.php +0 -0
  112. {admin → vendor/yoast}/api-libs/google/auth/Google_AuthNone.php +0 -0
  113. {admin → vendor/yoast}/api-libs/google/auth/Google_LoginTicket.php +0 -0
  114. {admin → vendor/yoast}/api-libs/google/auth/Google_OAuth2.php +0 -0
  115. {admin → vendor/yoast}/api-libs/google/auth/Google_P12Signer.php +0 -0
  116. {admin → vendor/yoast}/api-libs/google/auth/Google_PemVerifier.php +0 -0
  117. {admin → vendor/yoast}/api-libs/google/auth/Google_Signer.php +0 -0
  118. {admin → vendor/yoast}/api-libs/google/auth/Google_Verifier.php +0 -0
  119. {admin → vendor/yoast}/api-libs/google/cache/Google_ApcCache.php +0 -0
  120. {admin → vendor/yoast}/api-libs/google/cache/Google_Cache.php +0 -0
  121. {admin → vendor/yoast}/api-libs/google/cache/Google_FileCache.php +0 -0
  122. {admin → vendor/yoast}/api-libs/google/cache/Google_MemcacheCache.php +0 -0
  123. {admin → vendor/yoast}/api-libs/google/cache/Google_WPCache.php +0 -0
  124. vendor/yoast/api-libs/google/class-api-google.php +80 -0
  125. {admin → vendor/yoast}/api-libs/google/config.php +0 -0
  126. {admin → vendor/yoast}/api-libs/google/external/URITemplateParser.php +0 -0
  127. {admin → vendor/yoast}/api-libs/google/io/Google_CacheParser.php +0 -0
  128. {admin → vendor/yoast}/api-libs/google/io/Google_CurlIO.php +0 -0
  129. {admin → vendor/yoast}/api-libs/google/io/Google_HttpRequest.php +0 -0
  130. {admin → vendor/yoast}/api-libs/google/io/Google_HttpStreamIO.php +0 -0
  131. {admin → vendor/yoast}/api-libs/google/io/Google_IO.php +0 -0
  132. {admin → vendor/yoast}/api-libs/google/io/Google_REST.php +0 -0
  133. {admin → vendor/yoast}/api-libs/google/io/Google_WPIO.php +0 -0
  134. {admin → vendor/yoast}/api-libs/google/io/cacerts.pem +0 -0
  135. {admin → vendor/yoast}/api-libs/google/service/Google_BatchRequest.php +0 -0
  136. {admin → vendor/yoast}/api-libs/google/service/Google_MediaFileUpload.php +0 -0
  137. {admin → vendor/yoast}/api-libs/google/service/Google_Model.php +0 -0
  138. {admin → vendor/yoast}/api-libs/google/service/Google_Service.php +0 -0
  139. {admin → vendor/yoast}/api-libs/google/service/Google_ServiceResource.php +0 -0
  140. {admin → vendor/yoast}/api-libs/google/service/Google_Utils.php +0 -0
  141. vendor/yoast/api-libs/googleanalytics/class-api-googleanalytics.php +41 -0
  142. {admin → vendor/yoast}/api-libs/googleanalytics/class-google-analytics-client.php +1 -1
  143. {admin → vendor/yoast}/api-libs/googleanalytics/class-googleanalytics-reporting.php +1 -1
  144. {admin → vendor/yoast}/api-libs/tests/google/text-class-api-google.php +0 -0
  145. {admin → vendor/yoast}/api-libs/tests/googleanalytics/test-class-api-googleanalytics.php +0 -0
  146. {admin → vendor/yoast}/api-libs/tests/test-class-api-libs.php +0 -0
  147. {admin → vendor/yoast}/i18n-module/LICENSE +0 -0
  148. {admin → vendor/yoast}/i18n-module/README.md +0 -0
  149. vendor/yoast/i18n-module/composer.json +20 -0
  150. {admin → vendor/yoast}/i18n-module/i18n-module.php +3 -3
  151. {admin → vendor/yoast}/license-manager/README.md +0 -0
  152. {admin → vendor/yoast}/license-manager/class-api-request.php +0 -0
  153. {admin → vendor/yoast}/license-manager/class-license-manager.php +0 -0
  154. {admin → vendor/yoast}/license-manager/class-plugin-license-manager.php +0 -0
  155. {admin → vendor/yoast}/license-manager/class-plugin-update-manager.php +0 -0
  156. {admin → vendor/yoast}/license-manager/class-product.php +0 -0
  157. {admin → vendor/yoast}/license-manager/class-theme-license-manager.php +0 -0
  158. {admin → vendor/yoast}/license-manager/class-theme-update-manager.php +0 -0
  159. {admin → vendor/yoast}/license-manager/class-update-manager.php +0 -0
  160. {admin → vendor/yoast}/license-manager/composer.json +0 -0
  161. {admin → vendor/yoast}/license-manager/index.php +0 -0
  162. {admin → vendor/yoast}/license-manager/samples/index.php +0 -0
  163. {admin → vendor/yoast}/license-manager/samples/sample-plugin.php +0 -0
  164. {admin → vendor/yoast}/license-manager/samples/sample-product.php +0 -0
  165. {admin → vendor/yoast}/license-manager/samples/sample-theme-functions.php +0 -0
  166. {admin → vendor/yoast}/license-manager/views/form.php +0 -0
  167. {admin → vendor/yoast}/license-manager/views/index.php +0 -0
  168. {admin → vendor/yoast}/license-manager/views/script.php +0 -0
README.md CHANGED
@@ -17,10 +17,12 @@ Installation
17
  ------------
18
 
19
  Here's a [guide on how to install Google Analytics for WordPress in your WordPress site](http://yoast.com/wordpress/google-analytics/installation/).
20
- If you want to run the Git version though, you have two options:
21
 
22
- * You can clone the GitHub repository: https://github.com/Yoast/google-analytics-for-wordpress.git
23
- * Download it directly as a ZIP file: https://github.com/Yoast/google-analytics-for-wordpress/archive/master.zip
 
 
 
24
 
25
  This will download the latest development version of Google Analytics for WordPress by Yoast. While this version is usually stable,
26
  it is not recommended for use in a production environment.
17
  ------------
18
 
19
  Here's a [guide on how to install Google Analytics for WordPress in your WordPress site](http://yoast.com/wordpress/google-analytics/installation/).
 
20
 
21
+ If you want to run the Git version for development though, you can set it up with [Composer](https://getcomposer.org/):
22
+
23
+ ```bash
24
+ composer create-project yoast/google-analytics:dev-trunk --prefer-source --keep-vcs
25
+ ```
26
 
27
  This will download the latest development version of Google Analytics for WordPress by Yoast. While this version is usually stable,
28
  it is not recommended for use in a production environment.
admin/api-libs/README.md DELETED
@@ -1,2 +0,0 @@
1
- Yoast API libraries (Libs)
2
- ==========================
 
 
admin/api-libs/class-api-libs.php DELETED
@@ -1,136 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Include this class to use the Yoast_Api_Libs, you can include this as a submodule in your project
5
- * and you just have to autoload this class
6
- *
7
- *
8
- * NAMING CONVENTIONS
9
- * - Register 'oauth' by using $this->register_api_library()
10
- * - Create folder 'oauth'
11
- * - Create file 'class-api-oauth.php'
12
- * - Class name should be 'Yoast_Api_Oauth'
13
- */
14
-
15
- if ( ! class_exists( 'Yoast_Api_Libs' ) ) {
16
-
17
- class Yoast_Api_Libs {
18
-
19
- /**
20
- * Store the available API libraries
21
- *
22
- * @var array
23
- */
24
- private static $api_libs = array();
25
-
26
- /**
27
- * Store the instances of the API class
28
- *
29
- * @var array
30
- */
31
- private static $instances = array();
32
-
33
- /**
34
- * Call this method to init the libraries you need
35
- *
36
- * @param array $libraries
37
- *
38
- * @return bool True when at least 1 library is registered, False when there was 1 failure or when there is no class loaded at all
39
- */
40
- public static function load_api_libraries( $libraries = array() ) {
41
- $succeeded = 0;
42
- $failed = 0;
43
-
44
- if ( is_array( $libraries ) && count( $libraries ) >= 1 ) {
45
- foreach ( $libraries as $lib ) {
46
- if ( self::register_api_library( $lib ) ) {
47
- $succeeded ++;
48
- } else {
49
- $failed ++;
50
- }
51
- }
52
- }
53
-
54
- if ( $succeeded >= 1 && $failed == 0 ) {
55
- return true;
56
- } else {
57
- return false;
58
- }
59
- }
60
-
61
- /**
62
- * Get the registered API libraries
63
- *
64
- * @return array
65
- */
66
- public static function get_api_libs() {
67
- return self::$api_libs;
68
- }
69
-
70
- /**
71
- * Register a new API library to this class
72
- *
73
- * @param $name
74
- *
75
- * @return bool
76
- */
77
- private static function register_api_library( $name ) {
78
- $name = strtolower( $name );
79
- $classname = 'Yoast_Api_' . ucfirst( $name );
80
- $classpath = 'class-api-' . $name . '.php';
81
- $path_to_require = dirname( __FILE__ ) . '/' . $name . '/' . $classpath;
82
-
83
- self::$api_libs[$name] = array(
84
- 'name' => $name,
85
- 'classname' => $classname,
86
- 'classpath' => $classpath,
87
- 'path_to_require' => $path_to_require,
88
- );
89
-
90
- if ( file_exists( $path_to_require ) ) {
91
- include( $path_to_require );
92
-
93
- if ( class_exists( $classname ) ) {
94
- $instance = new $classname;
95
-
96
- self::$instances[$name] = $instance;
97
-
98
- return true;
99
- }
100
- }
101
-
102
- return false;
103
- }
104
-
105
- /**
106
- * Get instance
107
- *
108
- * @param $name
109
- *
110
- * @return bool
111
- */
112
- public function get_instance( $name ) {
113
- if ( isset( self::$instances[$name] ) ) {
114
- return self::$instances[$name];
115
- }
116
-
117
- return false;
118
- }
119
-
120
- /**
121
- * Execute a call with this method
122
- *
123
- * @param $instance
124
- * @param $method
125
- * @param array $params
126
- */
127
- public static function do_call( $instance, $method, $params = array() ) {
128
- $class = self::$instances[$instance];
129
-
130
- $class->$method( $params );
131
- // Call user func?
132
- }
133
-
134
- }
135
-
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/api-libs/google/class-api-google.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'Yoast_Api_Google' ) ) {
4
-
5
- class Yoast_Api_Google {
6
-
7
- public $options;
8
-
9
- /**
10
- * This class will be loaded when someone calls the API library with the Google analytics module
11
- */
12
- public function __construct() {
13
- $this->load_api_google_files();
14
- }
15
-
16
- /**
17
- * Register the Autoload the Google class
18
- */
19
- private function load_api_google_files() {
20
- spl_autoload_register( array( $this, 'autoload_api_google_files' ) );
21
- }
22
-
23
- /**
24
- * Autoload the API Google class
25
- *
26
- * @param string $class_name - The class that should be loaded
27
- */
28
- private function autoload_api_google_files( $class_name ) {
29
- $path = dirname( __FILE__ );
30
- $class_name = strtolower( $class_name );
31
- $oauth_files = array(
32
- // Main requires
33
- 'yoast_google_client' => 'Google_Client',
34
-
35
- // Requires in classes
36
- 'yoast_google_model' => 'service/Google_Model',
37
- 'yoast_google_service' => 'service/Google_Service',
38
- 'yoast_google_serviceresource' => 'service/Google_ServiceResource',
39
- 'yoast_google_assertion' => 'auth/Google_AssertionCredentials',
40
- 'yoast_google_signer' => 'auth/Google_Signer',
41
- 'yoast_google_p12signer' => 'auth/Google_P12Signer',
42
- 'yoast_google_batchrequest' => 'service/Google_BatchRequest',
43
- 'yoast_google_uritemplate' => 'external/URITemplateParser',
44
- 'yoast_google_auth' => 'auth/Google_Auth',
45
- 'yoast_google_cache' => 'cache/Google_Cache',
46
- 'yoast_google_io' => 'io/Google_IO',
47
- 'yoast_google_mediafileupload' => 'service/Google_MediaFileUpload',
48
- 'yoast_google_authnone' => 'auth/Google_AuthNone',
49
- 'yoast_google_oauth2' => 'auth/Google_OAuth2',
50
- 'yoast_google_verifier' => 'auth/Google_Verifier',
51
- 'yoast_google_loginticket' => 'auth/Google_LoginTicket',
52
- 'yoast_google_utils' => 'service/Google_Utils',
53
- 'yoast_google_pemverifier' => 'auth/Google_PemVerifier',
54
-
55
- // Caching
56
- 'yoast_google_filecache' => 'cache/Google_FileCache',
57
- 'yoast_google_memcachecache' => 'cache/Google_MemcacheCache',
58
- 'yoast_google_cacheparser' => 'io/Google_CacheParser',
59
-
60
- // Requests
61
- 'yoast_google_httprequest' => 'io/Google_HttpRequest',
62
- 'yoast_google_httpstream_io' => 'io/Google_HttpStreamIO',
63
- 'yoast_google_rest' => 'io/Google_REST',
64
-
65
- // Wordpress
66
- 'yoast_google_wpio' => 'io/Google_WPIO',
67
- 'yoast_google_wpcache' => 'cache/Google_WPCache',
68
-
69
- // REPLACE ME!
70
- 'yoast_google_curlio' => 'io/Google_CurlIO',
71
- );
72
-
73
- if ( ! empty( $oauth_files[$class_name] ) ) {
74
- if ( file_exists( $path . '/' . $oauth_files[$class_name] . '.php' ) ) {
75
- require_once( $path . '/' . $oauth_files[$class_name] . '.php' );
76
- }
77
-
78
- }
79
-
80
- }
81
-
82
- }
83
-
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/api-libs/googleanalytics/class-api-googleanalytics.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'Yoast_Api_Googleanalytics' ) ) {
4
-
5
- class Yoast_Api_Googleanalytics {
6
-
7
- public $options;
8
-
9
- /**
10
- * This class will be loaded when someone calls the API library with the Google analytics module
11
- */
12
- public function __construct() {
13
- $this->load_api_oauth_files();
14
- }
15
-
16
- /**
17
- * Register the Autoload the Oauth classes
18
- */
19
- private function load_api_oauth_files() {
20
- spl_autoload_register( array( $this, 'autoload_api_oauth_files' ) );
21
- }
22
-
23
- /**
24
- * Autoload the API Oauth classes
25
- *
26
- * @param string $class_name - The class that should be loaded
27
- */
28
- private function autoload_api_oauth_files( $class_name ) {
29
- $path = dirname( __FILE__ );
30
- $class_name = strtolower( $class_name );
31
- $oauth_files = array(
32
- 'yoast_googleanalytics_reporting' => 'class-googleanalytics-reporting',
33
- 'yoast_google_analytics_client' => 'class-google-analytics-client',
34
- );
35
-
36
- if ( ! empty( $oauth_files[$class_name] ) ) {
37
- if ( file_exists( $path . '/' . $oauth_files[$class_name] . '.php' ) ) {
38
- require_once( $path . '/' . $oauth_files[$class_name] . '.php' );
39
- }
40
-
41
- }
42
-
43
- }
44
-
45
- }
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/class-admin-form.php CHANGED
@@ -36,7 +36,11 @@ class Yoast_GA_Admin_Form {
36
  *
37
  * @return null|string
38
  */
39
- public static function end_form( $button_label = 'Save changes', $name = 'submit', $onclick = null ) {
 
 
 
 
40
  $output = null;
41
  $output .= '<div class="ga-form ga-form-input">';
42
  $output .= '<input type="submit" name="ga-form-' . $name . '" value="' . $button_label . '" class="button button-primary ga-form-submit" id="yoast-ga-form-submit-' . self::$form_namespace . '"';
36
  *
37
  * @return null|string
38
  */
39
+ public static function end_form( $button_label = null, $name = 'submit', $onclick = null ) {
40
+ if ( $button_label === null ) {
41
+ $button_label = __( 'Save changes', 'google-analytics-for-wordpress' );
42
+ }
43
+
44
  $output = null;
45
  $output .= '<div class="ga-form ga-form-input">';
46
  $output .= '<input type="submit" name="ga-form-' . $name . '" value="' . $button_label . '" class="button button-primary ga-form-submit" id="yoast-ga-form-submit-' . self::$form_namespace . '"';
admin/class-admin.php CHANGED
@@ -51,25 +51,9 @@ class Yoast_GA_Admin extends Yoast_GA_Options {
51
  Yoast_Google_Analytics::get_instance()->check_for_ga_issues();
52
  }
53
 
54
- if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
55
- if ( ! function_exists( 'wp_verify_nonce' ) ) {
56
- require_once( ABSPATH . 'wp-includes/pluggable.php' );
57
- }
58
-
59
- if ( isset( $_POST['ga-form-settings'] ) && wp_verify_nonce( $_POST['yoast_ga_nonce'], 'save_settings' ) ) {
60
- if ( ! isset ( $_POST['ignore_users'] ) ) {
61
- $_POST['ignore_users'] = array();
62
- }
63
-
64
- $dashboards_disabled = Yoast_GA_Settings::get_instance()->dashboards_disabled();
65
 
66
- if ( $dashboards_disabled == false && isset( $_POST['dashboards_disabled'] ) ) {
67
- $dashboards->reset_dashboards_data();
68
- }
69
-
70
- // Post submitted and verified with our nonce
71
- $this->save_settings( $_POST );
72
- }
73
  }
74
 
75
  /**
@@ -101,11 +85,8 @@ class Yoast_GA_Admin extends Yoast_GA_Options {
101
 
102
  // Check checkboxes, on a uncheck they won't be posted to this function
103
  $defaults = $this->default_ga_values();
104
- foreach ( $defaults[$this->option_prefix] as $key => $value ) {
105
- if ( ! isset( $data[$key] ) ) {
106
- // If no data was passed in, set it to the default.
107
- $this->options[$key] = $value;
108
- }
109
  }
110
 
111
  if ( ! empty( $this->options['analytics_profile'] ) ) {
@@ -146,6 +127,68 @@ class Yoast_GA_Admin extends Yoast_GA_Options {
146
 
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  /**
150
  * Are we allowed to show a warning message? returns true if it's allowed
151
  *
@@ -335,10 +378,11 @@ class Yoast_GA_Admin extends Yoast_GA_Options {
335
  * @api array $all_roles
336
  */
337
  $editable_roles = apply_filters( 'editable_roles', $all_roles );
 
338
  foreach ( $editable_roles as $id => $name ) {
339
  $roles[] = array(
340
  'id' => $id,
341
- 'name' => $name['name'],
342
  );
343
  }
344
 
@@ -352,8 +396,8 @@ class Yoast_GA_Admin extends Yoast_GA_Options {
352
  */
353
  public function track_download_types() {
354
  return array(
355
- 0 => array( 'id' => 'event', 'name' => 'Event' ),
356
- 1 => array( 'id' => 'pageview', 'name' => 'Pageview' ),
357
  );
358
  }
359
 
@@ -364,8 +408,8 @@ class Yoast_GA_Admin extends Yoast_GA_Options {
364
  */
365
  public function get_track_full_url() {
366
  return array(
367
- 0 => array( 'id' => 'domain', 'name' => 'Just the domain' ),
368
- 1 => array( 'id' => 'full_links', 'name' => 'Full links' ),
369
  );
370
  }
371
 
51
  Yoast_Google_Analytics::get_instance()->check_for_ga_issues();
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
56
+ $this->handle_ga_post_request( $dashboards );
 
 
 
 
 
57
  }
58
 
59
  /**
85
 
86
  // Check checkboxes, on a uncheck they won't be posted to this function
87
  $defaults = $this->default_ga_values();
88
+ foreach ( $defaults[$this->option_prefix] as $option_name => $value ) {
89
+ $this->handle_default_setting( $data, $option_name, $value );
 
 
 
90
  }
91
 
92
  if ( ! empty( $this->options['analytics_profile'] ) ) {
127
 
128
  }
129
 
130
+ /**
131
+ * Handle a default setting in GA
132
+ *
133
+ * @param $data
134
+ * @param $option_name
135
+ * @param $value
136
+ */
137
+ private function handle_default_setting( $data, $option_name, $value ) {
138
+ if ( ! isset( $data[$option_name] ) ) {
139
+ // If no data was passed in, set it to the default.
140
+ if ( $value === 1 ) {
141
+ // Disable the checkbox for now, use value 0
142
+ $this->options[$option_name] = 0;
143
+ } else {
144
+ $this->options[$option_name] = $value;
145
+ }
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Handle the post requests in the admin form of the GA plugin
151
+ *
152
+ * @param $dashboards
153
+ */
154
+ private function handle_ga_post_request( $dashboards ) {
155
+ if ( ! function_exists( 'wp_verify_nonce' ) ) {
156
+ require_once( ABSPATH . 'wp-includes/pluggable.php' );
157
+ }
158
+
159
+ if ( isset( $_POST['ga-form-settings'] ) && wp_verify_nonce( $_POST['yoast_ga_nonce'], 'save_settings' ) ) {
160
+ if ( ! isset ( $_POST['ignore_users'] ) ) {
161
+ $_POST['ignore_users'] = array();
162
+ }
163
+
164
+ $dashboards_disabled = Yoast_GA_Settings::get_instance()->dashboards_disabled();
165
+
166
+ if ( ( $dashboards_disabled == false && isset( $_POST['dashboards_disabled'] ) ) || $this->ga_profile_changed( $_POST ) ) {
167
+ $dashboards->reset_dashboards_data();
168
+ }
169
+
170
+ // Post submitted and verified with our nonce
171
+ $this->save_settings( $_POST );
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Is there selected an other property in the settings post? Returns true or false.
177
+ *
178
+ * @param $post
179
+ *
180
+ * @return bool
181
+ */
182
+ private function ga_profile_changed( $post ) {
183
+ if ( isset( $post['analytics_profile'] ) && isset( $this->options['analytics_profile'] ) ) {
184
+ if ( $post['analytics_profile'] != $this->options['analytics_profile'] ) {
185
+ return true;
186
+ }
187
+ }
188
+
189
+ return false;
190
+ }
191
+
192
  /**
193
  * Are we allowed to show a warning message? returns true if it's allowed
194
  *
378
  * @api array $all_roles
379
  */
380
  $editable_roles = apply_filters( 'editable_roles', $all_roles );
381
+
382
  foreach ( $editable_roles as $id => $name ) {
383
  $roles[] = array(
384
  'id' => $id,
385
+ 'name' => translate_user_role($name['name']),
386
  );
387
  }
388
 
396
  */
397
  public function track_download_types() {
398
  return array(
399
+ 0 => array( 'id' => 'event', 'name' => __( 'Event', 'google-analytics-for-wordpress' ) ),
400
+ 1 => array( 'id' => 'pageview', 'name' => __( 'Pageview', 'google-analytics-for-wordpress' ) ),
401
  );
402
  }
403
 
408
  */
409
  public function get_track_full_url() {
410
  return array(
411
+ 0 => array( 'id' => 'domain', 'name' => __( 'Just the domain', 'google-analytics-for-wordpress' ) ),
412
+ 1 => array( 'id' => 'full_links', 'name' => __( 'Full links', 'google-analytics-for-wordpress' ) ),
413
  );
414
  }
415
 
admin/pages/extensions.php CHANGED
@@ -32,16 +32,16 @@ $extensions = $yoast_ga_admin->get_extensions();
32
  <?php
33
  if ( 'uninstalled' == $extension->status ) {
34
  ?>
35
- <a target="_blank" href="<?php echo $extension->url; ?>#utm_medium=banner&utm_source=gawp-config&utm_campaign=extension-page-banners" class="button-primary">Get this extension</a>
36
  <?php
37
  } else {
38
  if ( 'inactive' == $extension->status ) {
39
  ?>
40
- <a href="#top#licenses" class="activate-link button-primary">Activate License</a>
41
  <?php
42
  } else {
43
  ?>
44
- <button class="button-primary installed">Installed</button>
45
  <?php
46
  }
47
  }
32
  <?php
33
  if ( 'uninstalled' == $extension->status ) {
34
  ?>
35
+ <a target="_blank" href="<?php echo $extension->url; ?>#utm_medium=banner&utm_source=gawp-config&utm_campaign=extension-page-banners" class="button-primary"><?php echo __( 'Get this extension', 'google-analytics-for-wordpress'); ?></a>
36
  <?php
37
  } else {
38
  if ( 'inactive' == $extension->status ) {
39
  ?>
40
+ <a href="#top#licenses" class="activate-link button-primary"><?php echo __( 'Activate License', 'google-analytics-for-wordpress'); ?></a>
41
  <?php
42
  } else {
43
  ?>
44
+ <button class="button-primary installed"><?php echo __( 'Installed', 'google-analytics-for-wordpress'); ?></button>
45
  <?php
46
  }
47
  }
admin/pages/settings.php CHANGED
@@ -92,7 +92,7 @@ echo Yoast_GA_Admin_Form::create_form( 'settings' );
92
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Track outbound click and downloads', 'google-analytics-for-wordpress' ), 'track_outbound', null, __( 'Clicks and downloads will be tracked as events, you can find these under Content &#xBB; Event Tracking in your Google Analytics reports.', 'google-analytics-for-wordpress' ) );
93
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Allow tracking of anonymous data', 'google-analytics-for-wordpress' ), 'anonymous_data', null, __( 'By allowing us to track anonymous data we can better help you, because we know with which WordPress configurations, themes and plugins we should test. No personal data will be submitted.', 'google-analytics-for-wordpress' ) );
94
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Anonymize IPs', 'google-analytics-for-wordpress' ), 'anonymize_ips', null, sprintf( __( 'This adds %1$s, telling Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gat?csw=1#_gat._anonymizeIp" target="_blank"><code>_anonymizeIp</code></a>' ) );
95
- echo Yoast_GA_Admin_Form::select( 'Ignore users', 'ignore_users', $yoast_ga_admin->get_userroles(), __( 'Users of the role you select will be ignored, so if you select Editor, all Editors will be ignored.', 'google-analytics-for-wordpress' ), true );
96
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Disable analytics dashboard', 'google-analytics-for-wordpress' ), 'dashboards_disabled', null, __( 'This will completely disable the dashboard and stop the plugin from fetching the latest analytics data.', 'google-analytics-for-wordpress' ) );
97
  ?>
98
  </div>
@@ -118,7 +118,7 @@ echo Yoast_GA_Admin_Form::create_form( 'settings' );
118
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Tag links in RSS feed with campaign variables', 'google-analytics-for-wordpress' ), 'tag_links_in_rss', null, __( 'Do not use this feature if you use FeedBurner, as FeedBurner can do this automatically and better than this plugin can. Check <a href="https://support.google.com/feedburner/answer/165769?hl=en&amp;ref_topic=13075" target="_blank">this help page</a> for info on how to enable this feature in FeedBurner.', 'google-analytics-for-wordpress' ) );
119
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Allow anchor', 'google-analytics-for-wordpress' ), 'allow_anchor', null , sprintf(__( 'This adds a %1$s call to your tracking code, and makes RSS link tagging use a %2$s as well.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking?csw=1#_gat.GA_Tracker_._setAllowAnchor" target="_blank"><code>_setAllowAnchor</code></a>', '<code>#</code>' ));
120
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Add <code>_setAllowLinker</code>', 'google-analytics-for-wordpress' ), 'add_allow_linker', null, sprintf( __( 'This adds a %1$s call to your tracking code, allowing you to use %2$s and related functions.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory?csw=1#_gat.GA_Tracker_._setAllowLinker" target="_blank"><code>_setAllowLinker</code></a>', ' <code>_link</code>' ) );
121
- echo Yoast_GA_Admin_Form::textarea( 'Custom code', 'custom_code', sprintf( __( 'Not for the average user: this allows you to add a line of code, to be added before the %1$s call.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._trackPageview" target="_blank"><code>_trackPageview</code></a>' ) );
122
 
123
  do_action( 'yst_ga_advanced-tab' );
124
  ?>
@@ -143,7 +143,7 @@ echo Yoast_GA_Admin_Form::create_form( 'settings' );
143
  </div>
144
  </div>
145
  <?php
146
- echo Yoast_GA_Admin_Form::end_form( 'Save changes', 'settings', 'yst_closepopupwindow();' );
147
  echo $yoast_ga_admin->content_footer();
148
  ?>
149
  <script type="text/javascript">
92
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Track outbound click and downloads', 'google-analytics-for-wordpress' ), 'track_outbound', null, __( 'Clicks and downloads will be tracked as events, you can find these under Content &#xBB; Event Tracking in your Google Analytics reports.', 'google-analytics-for-wordpress' ) );
93
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Allow tracking of anonymous data', 'google-analytics-for-wordpress' ), 'anonymous_data', null, __( 'By allowing us to track anonymous data we can better help you, because we know with which WordPress configurations, themes and plugins we should test. No personal data will be submitted.', 'google-analytics-for-wordpress' ) );
94
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Anonymize IPs', 'google-analytics-for-wordpress' ), 'anonymize_ips', null, sprintf( __( 'This adds %1$s, telling Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gat?csw=1#_gat._anonymizeIp" target="_blank"><code>_anonymizeIp</code></a>' ) );
95
+ echo Yoast_GA_Admin_Form::select( __( 'Ignore users', 'google-analytics-for-wordpress' ), 'ignore_users', $yoast_ga_admin->get_userroles(), __( 'Users of the role you select will be ignored, so if you select Editor, all Editors will be ignored.', 'google-analytics-for-wordpress' ), true );
96
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Disable analytics dashboard', 'google-analytics-for-wordpress' ), 'dashboards_disabled', null, __( 'This will completely disable the dashboard and stop the plugin from fetching the latest analytics data.', 'google-analytics-for-wordpress' ) );
97
  ?>
98
  </div>
118
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Tag links in RSS feed with campaign variables', 'google-analytics-for-wordpress' ), 'tag_links_in_rss', null, __( 'Do not use this feature if you use FeedBurner, as FeedBurner can do this automatically and better than this plugin can. Check <a href="https://support.google.com/feedburner/answer/165769?hl=en&amp;ref_topic=13075" target="_blank">this help page</a> for info on how to enable this feature in FeedBurner.', 'google-analytics-for-wordpress' ) );
119
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Allow anchor', 'google-analytics-for-wordpress' ), 'allow_anchor', null , sprintf(__( 'This adds a %1$s call to your tracking code, and makes RSS link tagging use a %2$s as well.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking?csw=1#_gat.GA_Tracker_._setAllowAnchor" target="_blank"><code>_setAllowAnchor</code></a>', '<code>#</code>' ));
120
  echo Yoast_GA_Admin_Form::input( 'checkbox', __( 'Add <code>_setAllowLinker</code>', 'google-analytics-for-wordpress' ), 'add_allow_linker', null, sprintf( __( 'This adds a %1$s call to your tracking code, allowing you to use %2$s and related functions.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory?csw=1#_gat.GA_Tracker_._setAllowLinker" target="_blank"><code>_setAllowLinker</code></a>', ' <code>_link</code>' ) );
121
+ echo Yoast_GA_Admin_Form::textarea( __( 'Custom code', 'google-analytics-for-wordpress' ), 'custom_code', sprintf( __( 'Not for the average user: this allows you to add a line of code, to be added before the %1$s call.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._trackPageview" target="_blank"><code>_trackPageview</code></a>' ) );
122
 
123
  do_action( 'yst_ga_advanced-tab' );
124
  ?>
143
  </div>
144
  </div>
145
  <?php
146
+ echo Yoast_GA_Admin_Form::end_form( __( 'Save changes', 'google-analytics-for-wordpress' ), 'settings', 'yst_closepopupwindow();' );
147
  echo $yoast_ga_admin->content_footer();
148
  ?>
149
  <script type="text/javascript">
googleanalytics.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Analytics by Yoast
4
  Plugin URI: https://yoast.com/wordpress/plugins/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wpgaplugin&utm_content=v504
5
  Description: This plugin makes it simple to add Google Analytics to your WordPress site, adding lots of features, e.g. error page, search result and automatic outgoing links and download tracking.
6
  Author: Team Yoast
7
- Version: 5.3.1
8
  Requires at least: 3.8
9
  Author URI: https://yoast.com/
10
  License: GPL v3
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30
 
31
  // This plugin was originally based on Rich Boakes' Analytics plugin: http://boakes.org/analytics, but has since been rewritten and refactored multiple times.
32
 
33
- define( 'GAWP_VERSION', '5.3.1' );
34
 
35
  define( 'GAWP_FILE', __FILE__ );
36
 
@@ -38,8 +38,8 @@ define( 'GAWP_PATH', plugin_basename( __FILE__ ) );
38
 
39
  define( 'GAWP_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
40
 
41
- if ( ! class_exists( 'Yoast_GA_Autoload', false ) ) {
42
- require_once 'includes/class-autoload.php';
43
  }
44
 
45
  // Only require the needed classes
4
  Plugin URI: https://yoast.com/wordpress/plugins/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wpgaplugin&utm_content=v504
5
  Description: This plugin makes it simple to add Google Analytics to your WordPress site, adding lots of features, e.g. error page, search result and automatic outgoing links and download tracking.
6
  Author: Team Yoast
7
+ Version: 5.3.2
8
  Requires at least: 3.8
9
  Author URI: https://yoast.com/
10
  License: GPL v3
30
 
31
  // This plugin was originally based on Rich Boakes' Analytics plugin: http://boakes.org/analytics, but has since been rewritten and refactored multiple times.
32
 
33
+ define( 'GAWP_VERSION', '5.3.2' );
34
 
35
  define( 'GAWP_FILE', __FILE__ );
36
 
38
 
39
  define( 'GAWP_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
40
 
41
+ if ( file_exists( dirname( GAWP_FILE ) . '/vendor/autoload_52.php' ) ) {
42
+ require dirname( GAWP_FILE ) . '/vendor/autoload_52.php';
43
  }
44
 
45
  // Only require the needed classes
includes/class-autoload.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'Yoast_GA_Autoload' ) ) {
4
-
5
- class Yoast_GA_Autoload {
6
-
7
- private static $classes = null;
8
-
9
- public static function autoload( $class ) {
10
-
11
- $include_path = dirname( GAWP_FILE );
12
-
13
- if ( self::$classes === null ) {
14
-
15
- self::$classes = array(
16
- 'yoast_ga_options' => 'includes/class-options',
17
- 'yoast_ga_settings' => 'includes/class-settings',
18
- 'yoast_ga_utils' => 'includes/class-utils',
19
-
20
- // Frontend classes
21
- 'yoast_ga_tracking' => 'frontend/abstract-class-tracking',
22
- 'yoast_ga_frontend' => 'frontend/class-frontend',
23
- 'yoast_ga_universal' => 'frontend/class-universal',
24
- 'yoast_ga_js' => 'frontend/class-ga-js',
25
-
26
- // Admin classes
27
- 'yoast_ga_admin' => 'admin/class-admin',
28
- 'yoast_ga_admin_menu' => 'admin/class-admin-menu',
29
- 'yoast_google_analytics' => 'admin/class-google-analytics',
30
- 'yoast_google_analytics_notice' => 'admin/class-google-analytics',
31
- 'yoast_ga_admin_assets' => 'admin/class-admin-assets',
32
- 'yoast_ga_admin_form' => 'admin/class-admin-form',
33
-
34
- // Dashboards
35
- 'yoast_ga_dashboards_api_options' => 'admin/dashboards/class-admin-dashboards-api-options',
36
- 'yoast_ga_dashboards' => 'admin/dashboards/class-admin-dashboards',
37
- 'yoast_ga_dashboards_collector' => 'admin/dashboards/class-admin-dashboards-collector',
38
- 'yoast_ga_dashboards_data' => 'admin/dashboards/class-admin-dashboards-data',
39
-
40
- 'yoast_ga_dashboards_display' => 'admin/dashboards/class-admin-dashboards-display',
41
- 'yoast_ga_dashboards_driver' => 'admin/dashboards/drivers/class-admin-dashboards-driver',
42
- 'yoast_ga_dashboards_driver_generate' => 'admin/dashboards/drivers/class-admin-dashboards-driver-generate',
43
- 'yoast_ga_dashboards_table' => 'admin/dashboards/drivers/class-admin-dashboards-table',
44
- 'yoast_ga_dashboards_table_generate' => 'admin/dashboards/drivers/class-admin-dashboards-table-generate',
45
- 'yoast_ga_dashboards_graph' => 'admin/dashboards/drivers/class-admin-dashboards-graph',
46
- 'yoast_ga_dashboards_graph_generate' => 'admin/dashboards/drivers/class-admin-dashboards-graph-generate',
47
-
48
- // License manager
49
- 'yoast_license_manager' => 'admin/license-manager/class-license-manager',
50
- 'yoast_plugin_license_manager' => 'admin/license-manager/class-plugin-license-manager',
51
- 'yoast_product' => 'admin/license-manager/class-product',
52
-
53
- // API libraries
54
- 'yoast_api_libs' => 'admin/api-libs/class-api-libs',
55
-
56
- // i18n module
57
- 'yoast_i18n' => 'admin/i18n-module/i18n-module',
58
-
59
- );
60
- }
61
-
62
- $class_name = strtolower( $class );
63
- if ( ! class_exists( $class ) && isset( self::$classes[$class_name] ) ) {
64
- require_once $include_path . '/' . self::$classes[$class_name] . '.php';
65
- }
66
- }
67
- }
68
-
69
- // register class autoloader
70
- spl_autoload_register( array( 'Yoast_GA_Autoload', 'autoload' ) );
71
-
72
- }
73
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-options.php CHANGED
@@ -246,7 +246,7 @@ class Yoast_GA_Options {
246
  'track_internal_as_label' => null,
247
  'track_outbound' => 0,
248
  'anonymous_data' => 0,
249
- 'enable_universal' => 0,
250
  'demographics' => 0,
251
  'ignore_users' => array( 'editor' ),
252
  'dashboards_disabled' => 0,
246
  'track_internal_as_label' => null,
247
  'track_outbound' => 0,
248
  'anonymous_data' => 0,
249
+ 'enable_universal' => 1,
250
  'demographics' => 0,
251
  'ignore_users' => array( 'editor' ),
252
  'dashboards_disabled' => 0,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://yoast.com/donate/
4
  Tags: analytics, google analytics, statistics, tracking, stats, google, yoast
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
- Stable tag: 5.3.1
8
 
9
  Track your WordPress site easily with the latest tracking codes and lots added data for search result pages and error pages.
10
 
@@ -49,6 +49,17 @@ This section describes how to install the plugin and get it working.
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
 
 
 
 
 
52
  = 5.3.1 =
53
 
54
  Release Date: February 11th, 2015
4
  Tags: analytics, google analytics, statistics, tracking, stats, google, yoast
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
+ Stable tag: 5.3.2
8
 
9
  Track your WordPress site easily with the latest tracking codes and lots added data for search result pages and error pages.
10
 
49
 
50
  == Changelog ==
51
 
52
+ = 5.3.2 =
53
+
54
+ Release Date: February 18th, 2015
55
+
56
+ * Enhancements:
57
+ * Throws away the GA data when a user changes his GA profile.
58
+ * Makes a few strings translatable that were not translatable yet.
59
+
60
+ * Bugfixes:
61
+ * Fixes the "Missing class information" Zend error that was caused by our api-libs package.
62
+
63
  = 5.3.1 =
64
 
65
  Release Date: February 11th, 2015
vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer' . '/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit0d7371c5917637133046e0ff54bddc2c::getLoader();
vendor/autoload_52.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_52.php generated by xrstf/composer-php52
4
+
5
+ require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
+
7
+ return ComposerAutoloaderInitcb51162ef6e25f026ad6e42d5cb3b865::getLoader();
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 class loader
17
+ *
18
+ * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
19
+ *
20
+ * $loader = new \Composer\Autoload\ClassLoader();
21
+ *
22
+ * // register classes with namespaces
23
+ * $loader->add('Symfony\Component', __DIR__.'/component');
24
+ * $loader->add('Symfony', __DIR__.'/framework');
25
+ *
26
+ * // activate the autoloader
27
+ * $loader->register();
28
+ *
29
+ * // to enable searching the include path (eg. for PEAR packages)
30
+ * $loader->setUseIncludePath(true);
31
+ *
32
+ * In this example, if you try to use a class in the Symfony\Component
33
+ * namespace or one of its children (Symfony\Component\Console for instance),
34
+ * the autoloader will first look for the class under the component/
35
+ * directory, and it will then fallback to the framework/ directory if not
36
+ * found before giving up.
37
+ *
38
+ * This class is loosely based on the Symfony UniversalClassLoader.
39
+ *
40
+ * @author Fabien Potencier <fabien@symfony.com>
41
+ * @author Jordi Boggiano <j.boggiano@seld.be>
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
+
57
+ private $classMapAuthoritative = false;
58
+
59
+ public function getPrefixes()
60
+ {
61
+ if (!empty($this->prefixesPsr0)) {
62
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
63
+ }
64
+
65
+ return array();
66
+ }
67
+
68
+ public function getPrefixesPsr4()
69
+ {
70
+ return $this->prefixDirsPsr4;
71
+ }
72
+
73
+ public function getFallbackDirs()
74
+ {
75
+ return $this->fallbackDirsPsr0;
76
+ }
77
+
78
+ public function getFallbackDirsPsr4()
79
+ {
80
+ return $this->fallbackDirsPsr4;
81
+ }
82
+
83
+ public function getClassMap()
84
+ {
85
+ return $this->classMap;
86
+ }
87
+
88
+ /**
89
+ * @param array $classMap Class to filename map
90
+ */
91
+ public function addClassMap(array $classMap)
92
+ {
93
+ if ($this->classMap) {
94
+ $this->classMap = array_merge($this->classMap, $classMap);
95
+ } else {
96
+ $this->classMap = $classMap;
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Registers a set of PSR-0 directories for a given prefix, either
102
+ * appending or prepending to the ones previously set for this prefix.
103
+ *
104
+ * @param string $prefix The prefix
105
+ * @param array|string $paths The PSR-0 root directories
106
+ * @param bool $prepend Whether to prepend the directories
107
+ */
108
+ public function add($prefix, $paths, $prepend = false)
109
+ {
110
+ if (!$prefix) {
111
+ if ($prepend) {
112
+ $this->fallbackDirsPsr0 = array_merge(
113
+ (array) $paths,
114
+ $this->fallbackDirsPsr0
115
+ );
116
+ } else {
117
+ $this->fallbackDirsPsr0 = array_merge(
118
+ $this->fallbackDirsPsr0,
119
+ (array) $paths
120
+ );
121
+ }
122
+
123
+ return;
124
+ }
125
+
126
+ $first = $prefix[0];
127
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
+
130
+ return;
131
+ }
132
+ if ($prepend) {
133
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
134
+ (array) $paths,
135
+ $this->prefixesPsr0[$first][$prefix]
136
+ );
137
+ } else {
138
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
139
+ $this->prefixesPsr0[$first][$prefix],
140
+ (array) $paths
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Registers a set of PSR-4 directories for a given namespace, either
147
+ * appending or prepending to the ones previously set for this namespace.
148
+ *
149
+ * @param string $prefix The prefix/namespace, with trailing '\\'
150
+ * @param array|string $paths The PSR-0 base directories
151
+ * @param bool $prepend Whether to prepend the directories
152
+ *
153
+ * @throws \InvalidArgumentException
154
+ */
155
+ public function addPsr4($prefix, $paths, $prepend = false)
156
+ {
157
+ if (!$prefix) {
158
+ // Register directories for the root namespace.
159
+ if ($prepend) {
160
+ $this->fallbackDirsPsr4 = array_merge(
161
+ (array) $paths,
162
+ $this->fallbackDirsPsr4
163
+ );
164
+ } else {
165
+ $this->fallbackDirsPsr4 = array_merge(
166
+ $this->fallbackDirsPsr4,
167
+ (array) $paths
168
+ );
169
+ }
170
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
+ // Register directories for a new namespace.
172
+ $length = strlen($prefix);
173
+ if ('\\' !== $prefix[$length - 1]) {
174
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
+ }
176
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
+ } elseif ($prepend) {
179
+ // Prepend directories for an already registered namespace.
180
+ $this->prefixDirsPsr4[$prefix] = array_merge(
181
+ (array) $paths,
182
+ $this->prefixDirsPsr4[$prefix]
183
+ );
184
+ } else {
185
+ // Append directories for an already registered namespace.
186
+ $this->prefixDirsPsr4[$prefix] = array_merge(
187
+ $this->prefixDirsPsr4[$prefix],
188
+ (array) $paths
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Registers a set of PSR-0 directories for a given prefix,
195
+ * replacing any others previously set for this prefix.
196
+ *
197
+ * @param string $prefix The prefix
198
+ * @param array|string $paths The PSR-0 base directories
199
+ */
200
+ public function set($prefix, $paths)
201
+ {
202
+ if (!$prefix) {
203
+ $this->fallbackDirsPsr0 = (array) $paths;
204
+ } else {
205
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Registers a set of PSR-4 directories for a given namespace,
211
+ * replacing any others previously set for this namespace.
212
+ *
213
+ * @param string $prefix The prefix/namespace, with trailing '\\'
214
+ * @param array|string $paths The PSR-4 base directories
215
+ *
216
+ * @throws \InvalidArgumentException
217
+ */
218
+ public function setPsr4($prefix, $paths)
219
+ {
220
+ if (!$prefix) {
221
+ $this->fallbackDirsPsr4 = (array) $paths;
222
+ } else {
223
+ $length = strlen($prefix);
224
+ if ('\\' !== $prefix[$length - 1]) {
225
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
+ }
227
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Turns on searching the include path for class files.
234
+ *
235
+ * @param bool $useIncludePath
236
+ */
237
+ public function setUseIncludePath($useIncludePath)
238
+ {
239
+ $this->useIncludePath = $useIncludePath;
240
+ }
241
+
242
+ /**
243
+ * Can be used to check if the autoloader uses the include path to check
244
+ * for classes.
245
+ *
246
+ * @return bool
247
+ */
248
+ public function getUseIncludePath()
249
+ {
250
+ return $this->useIncludePath;
251
+ }
252
+
253
+ /**
254
+ * Turns off searching the prefix and fallback directories for classes
255
+ * that have not been registered with the class map.
256
+ *
257
+ * @param bool $classMapAuthoritative
258
+ */
259
+ public function setClassMapAuthoritative($classMapAuthoritative)
260
+ {
261
+ $this->classMapAuthoritative = $classMapAuthoritative;
262
+ }
263
+
264
+ /**
265
+ * Should class lookup fail if not found in the current class map?
266
+ *
267
+ * @return bool
268
+ */
269
+ public function isClassMapAuthoritative()
270
+ {
271
+ return $this->classMapAuthoritative;
272
+ }
273
+
274
+ /**
275
+ * Registers this instance as an autoloader.
276
+ *
277
+ * @param bool $prepend Whether to prepend the autoloader or not
278
+ */
279
+ public function register($prepend = false)
280
+ {
281
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
+ }
283
+
284
+ /**
285
+ * Unregisters this instance as an autoloader.
286
+ */
287
+ public function unregister()
288
+ {
289
+ spl_autoload_unregister(array($this, 'loadClass'));
290
+ }
291
+
292
+ /**
293
+ * Loads the given class or interface.
294
+ *
295
+ * @param string $class The name of the class
296
+ * @return bool|null True if loaded, null otherwise
297
+ */
298
+ public function loadClass($class)
299
+ {
300
+ if ($file = $this->findFile($class)) {
301
+ includeFile($file);
302
+
303
+ return true;
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Finds the path to the file where the class is defined.
309
+ *
310
+ * @param string $class The name of the class
311
+ *
312
+ * @return string|false The path if found, false otherwise
313
+ */
314
+ public function findFile($class)
315
+ {
316
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
+ if ('\\' == $class[0]) {
318
+ $class = substr($class, 1);
319
+ }
320
+
321
+ // class map lookup
322
+ if (isset($this->classMap[$class])) {
323
+ return $this->classMap[$class];
324
+ }
325
+ if ($this->classMapAuthoritative) {
326
+ return false;
327
+ }
328
+
329
+ $file = $this->findFileWithExtension($class, '.php');
330
+
331
+ // Search for Hack files if we are running on HHVM
332
+ if ($file === null && defined('HHVM_VERSION')) {
333
+ $file = $this->findFileWithExtension($class, '.hh');
334
+ }
335
+
336
+ if ($file === null) {
337
+ // Remember that this class does not exist.
338
+ return $this->classMap[$class] = false;
339
+ }
340
+
341
+ return $file;
342
+ }
343
+
344
+ private function findFileWithExtension($class, $ext)
345
+ {
346
+ // PSR-4 lookup
347
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
+
349
+ $first = $class[0];
350
+ if (isset($this->prefixLengthsPsr4[$first])) {
351
+ foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
+ if (0 === strpos($class, $prefix)) {
353
+ foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
+ return $file;
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ // PSR-4 fallback dirs
363
+ foreach ($this->fallbackDirsPsr4 as $dir) {
364
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
+ return $file;
366
+ }
367
+ }
368
+
369
+ // PSR-0 lookup
370
+ if (false !== $pos = strrpos($class, '\\')) {
371
+ // namespaced class name
372
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
+ } else {
375
+ // PEAR-like class name
376
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
+ }
378
+
379
+ if (isset($this->prefixesPsr0[$first])) {
380
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
+ if (0 === strpos($class, $prefix)) {
382
+ foreach ($dirs as $dir) {
383
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
+ return $file;
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ // PSR-0 fallback dirs
392
+ foreach ($this->fallbackDirsPsr0 as $dir) {
393
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
+ return $file;
395
+ }
396
+ }
397
+
398
+ // PSR-0 include paths.
399
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
+ return $file;
401
+ }
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Scope isolated include.
407
+ *
408
+ * Prevents access to $this/self from included files.
409
+ */
410
+ function includeFile($file)
411
+ {
412
+ include $file;
413
+ }
vendor/composer/ClassLoader52.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ *
12
+ * 99% of this is copied as-is from the original Composer source code and is
13
+ * released under MIT license as well. Copyright goes to:
14
+ *
15
+ * - Fabien Potencier <fabien@symfony.com>
16
+ * - Jordi Boggiano <j.boggiano@seld.be>
17
+ */
18
+
19
+ class xrstf_Composer52_ClassLoader {
20
+ private $prefixes = array();
21
+ private $fallbackDirs = array();
22
+ private $useIncludePath = false;
23
+ private $classMap = array();
24
+ private $classMapAuthoratative = false;
25
+ private $allowUnderscore = false;
26
+
27
+ /**
28
+ * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
+ */
30
+ public function setAllowUnderscore($flag) {
31
+ $this->allowUnderscore = (boolean) $flag;
32
+ }
33
+
34
+ /**
35
+ * @return array
36
+ */
37
+ public function getPrefixes() {
38
+ return $this->prefixes;
39
+ }
40
+
41
+ /**
42
+ * Turns off searching the prefix and fallback directories for classes
43
+ * that have not been registered with the class map.
44
+ *
45
+ * @param bool $classMapAuthoratative
46
+ */
47
+ public function setClassMapAuthoritative($classMapAuthoratative) {
48
+ $this->classMapAuthoratative = $classMapAuthoratative;
49
+ }
50
+
51
+ /**
52
+ * Should class lookup fail if not found in the current class map?
53
+ *
54
+ * @return bool
55
+ */
56
+ public function getClassMapAuthoratative() {
57
+ return $this->classMapAuthoratative;
58
+ }
59
+
60
+ /**
61
+ * @return array
62
+ */
63
+ public function getFallbackDirs() {
64
+ return $this->fallbackDirs;
65
+ }
66
+
67
+ /**
68
+ * @return array
69
+ */
70
+ public function getClassMap() {
71
+ return $this->classMap;
72
+ }
73
+
74
+ /**
75
+ * @param array $classMap class to filename map
76
+ */
77
+ public function addClassMap(array $classMap) {
78
+ if ($this->classMap) {
79
+ $this->classMap = array_merge($this->classMap, $classMap);
80
+ }
81
+ else {
82
+ $this->classMap = $classMap;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Registers a set of classes, merging with any others previously set.
88
+ *
89
+ * @param string $prefix the classes prefix
90
+ * @param array|string $paths the location(s) of the classes
91
+ * @param bool $prepend prepend the location(s)
92
+ */
93
+ public function add($prefix, $paths, $prepend = false) {
94
+ if (!$prefix) {
95
+ if ($prepend) {
96
+ $this->fallbackDirs = array_merge(
97
+ (array) $paths,
98
+ $this->fallbackDirs
99
+ );
100
+ }
101
+ else {
102
+ $this->fallbackDirs = array_merge(
103
+ $this->fallbackDirs,
104
+ (array) $paths
105
+ );
106
+ }
107
+
108
+ return;
109
+ }
110
+
111
+ if (!isset($this->prefixes[$prefix])) {
112
+ $this->prefixes[$prefix] = (array) $paths;
113
+ return;
114
+ }
115
+
116
+ if ($prepend) {
117
+ $this->prefixes[$prefix] = array_merge(
118
+ (array) $paths,
119
+ $this->prefixes[$prefix]
120
+ );
121
+ }
122
+ else {
123
+ $this->prefixes[$prefix] = array_merge(
124
+ $this->prefixes[$prefix],
125
+ (array) $paths
126
+ );
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Registers a set of classes, replacing any others previously set.
132
+ *
133
+ * @param string $prefix the classes prefix
134
+ * @param array|string $paths the location(s) of the classes
135
+ */
136
+ public function set($prefix, $paths) {
137
+ if (!$prefix) {
138
+ $this->fallbackDirs = (array) $paths;
139
+ return;
140
+ }
141
+
142
+ $this->prefixes[$prefix] = (array) $paths;
143
+ }
144
+
145
+ /**
146
+ * Turns on searching the include path for class files.
147
+ *
148
+ * @param bool $useIncludePath
149
+ */
150
+ public function setUseIncludePath($useIncludePath) {
151
+ $this->useIncludePath = $useIncludePath;
152
+ }
153
+
154
+ /**
155
+ * Can be used to check if the autoloader uses the include path to check
156
+ * for classes.
157
+ *
158
+ * @return bool
159
+ */
160
+ public function getUseIncludePath() {
161
+ return $this->useIncludePath;
162
+ }
163
+
164
+ /**
165
+ * Registers this instance as an autoloader.
166
+ */
167
+ public function register() {
168
+ spl_autoload_register(array($this, 'loadClass'), true);
169
+ }
170
+
171
+ /**
172
+ * Unregisters this instance as an autoloader.
173
+ */
174
+ public function unregister() {
175
+ spl_autoload_unregister(array($this, 'loadClass'));
176
+ }
177
+
178
+ /**
179
+ * Loads the given class or interface.
180
+ *
181
+ * @param string $class the name of the class
182
+ * @return bool|null true, if loaded
183
+ */
184
+ public function loadClass($class) {
185
+ if ($file = $this->findFile($class)) {
186
+ include $file;
187
+ return true;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Finds the path to the file where the class is defined.
193
+ *
194
+ * @param string $class the name of the class
195
+ * @return string|null the path, if found
196
+ */
197
+ public function findFile($class) {
198
+ if ('\\' === $class[0]) {
199
+ $class = substr($class, 1);
200
+ }
201
+
202
+ if (isset($this->classMap[$class])) {
203
+ return $this->classMap[$class];
204
+ }
205
+ elseif ($this->classMapAuthoratative) {
206
+ return false;
207
+ }
208
+
209
+ $classPath = $this->getClassPath($class);
210
+
211
+ foreach ($this->prefixes as $prefix => $dirs) {
212
+ if (0 === strpos($class, $prefix)) {
213
+ foreach ($dirs as $dir) {
214
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ foreach ($this->fallbackDirs as $dir) {
222
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
224
+ }
225
+ }
226
+
227
+ if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
+ return $file;
229
+ }
230
+
231
+ return $this->classMap[$class] = false;
232
+ }
233
+
234
+ private function getClassPath($class) {
235
+ if (false !== $pos = strrpos($class, '\\')) {
236
+ // namespaced class name
237
+ $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
+ $className = substr($class, $pos + 1);
239
+ }
240
+ else {
241
+ // PEAR-like class name
242
+ $classPath = null;
243
+ $className = $class;
244
+ }
245
+
246
+ $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
+
248
+ // restore the prefix
249
+ if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
+ $className[0] = '_';
251
+ }
252
+
253
+ $classPath .= $className.'.php';
254
+
255
+ return $classPath;
256
+ }
257
+
258
+ public static function resolveIncludePath($classPath) {
259
+ $paths = explode(PATH_SEPARATOR, get_include_path());
260
+
261
+ foreach ($paths as $path) {
262
+ $path = rtrim($path, '/\\');
263
+
264
+ if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
+ return $file;
266
+ }
267
+ }
268
+
269
+ return false;
270
+ }
271
+ }
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ 'Yoast_API_Request' => $vendorDir . '/yoast/license-manager/class-api-request.php',
10
+ 'Yoast_Api_Libs' => $vendorDir . '/yoast/api-libs/class-api-libs.php',
11
+ 'Yoast_GA_Admin' => $baseDir . '/admin/class-admin.php',
12
+ 'Yoast_GA_Admin_Assets' => $baseDir . '/admin/class-admin-assets.php',
13
+ 'Yoast_GA_Admin_Form' => $baseDir . '/admin/class-admin-form.php',
14
+ 'Yoast_GA_Admin_Menu' => $baseDir . '/admin/class-admin-menu.php',
15
+ 'Yoast_GA_Dashboards' => $baseDir . '/admin/dashboards/class-admin-dashboards.php',
16
+ 'Yoast_GA_Dashboards_Api_Options' => $baseDir . '/admin/dashboards/class-admin-dashboards-api-options.php',
17
+ 'Yoast_GA_Dashboards_Collector' => $baseDir . '/admin/dashboards/class-admin-dashboards-collector.php',
18
+ 'Yoast_GA_Dashboards_Data' => $baseDir . '/admin/dashboards/class-admin-dashboards-data.php',
19
+ 'Yoast_GA_Dashboards_Display' => $baseDir . '/admin/dashboards/class-admin-dashboards-display.php',
20
+ 'Yoast_GA_Dashboards_Driver' => $baseDir . '/admin/dashboards/drivers/class-admin-dashboards-driver.php',
21
+ 'Yoast_GA_Dashboards_Driver_Generate' => $baseDir . '/admin/dashboards/drivers/class-admin-dashboards-driver-generate.php',
22
+ 'Yoast_GA_Dashboards_Graph' => $baseDir . '/admin/dashboards/drivers/class-admin-dashboards-graph.php',
23
+ 'Yoast_GA_Dashboards_Graph_Generate' => $baseDir . '/admin/dashboards/drivers/class-admin-dashboards-graph-generate.php',
24
+ 'Yoast_GA_Dashboards_Table' => $baseDir . '/admin/dashboards/drivers/class-admin-dashboards-table.php',
25
+ 'Yoast_GA_Dashboards_Table_Generate' => $baseDir . '/admin/dashboards/drivers/class-admin-dashboards-table-generate.php',
26
+ 'Yoast_GA_Frontend' => $baseDir . '/frontend/class-frontend.php',
27
+ 'Yoast_GA_JS' => $baseDir . '/frontend/class-ga-js.php',
28
+ 'Yoast_GA_Options' => $baseDir . '/includes/class-options.php',
29
+ 'Yoast_GA_Settings' => $baseDir . '/includes/class-settings.php',
30
+ 'Yoast_GA_Tracking' => $baseDir . '/frontend/abstract-class-tracking.php',
31
+ 'Yoast_GA_Universal' => $baseDir . '/frontend/class-universal.php',
32
+ 'Yoast_GA_Utils' => $baseDir . '/includes/class-utils.php',
33
+ 'Yoast_Google_Analytics' => $baseDir . '/admin/class-google-analytics.php',
34
+ 'Yoast_Google_Analytics_Notice' => $baseDir . '/admin/class-google-analytics.php',
35
+ 'Yoast_License_Manager' => $vendorDir . '/yoast/license-manager/class-license-manager.php',
36
+ 'Yoast_Plugin_License_Manager' => $vendorDir . '/yoast/license-manager/class-plugin-license-manager.php',
37
+ 'Yoast_Plugin_Update_Manager' => $vendorDir . '/yoast/license-manager/class-plugin-update-manager.php',
38
+ 'Yoast_Product' => $vendorDir . '/yoast/license-manager/class-product.php',
39
+ 'Yoast_Theme_License_Manager' => $vendorDir . '/yoast/license-manager/class-theme-license-manager.php',
40
+ 'Yoast_Theme_Update_Manager' => $vendorDir . '/yoast/license-manager/class-theme-update-manager.php',
41
+ 'Yoast_Update_Manager' => $vendorDir . '/yoast/license-manager/class-update-manager.php',
42
+ 'iYoast_License_Manager' => $vendorDir . '/yoast/license-manager/class-license-manager.php',
43
+ 'yoast_i18n' => $vendorDir . '/yoast/i18n-module/i18n-module.php',
44
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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
+ 'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
+ 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src'),
11
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit0d7371c5917637133046e0ff54bddc2c
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('ComposerAutoloaderInit0d7371c5917637133046e0ff54bddc2c', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit0d7371c5917637133046e0ff54bddc2c', 'loadClassLoader'));
25
+
26
+ $map = require __DIR__ . '/autoload_namespaces.php';
27
+ foreach ($map as $namespace => $path) {
28
+ $loader->set($namespace, $path);
29
+ }
30
+
31
+ $map = require __DIR__ . '/autoload_psr4.php';
32
+ foreach ($map as $namespace => $path) {
33
+ $loader->setPsr4($namespace, $path);
34
+ }
35
+
36
+ $classMap = require __DIR__ . '/autoload_classmap.php';
37
+ if ($classMap) {
38
+ $loader->addClassMap($classMap);
39
+ }
40
+
41
+ $loader->register(true);
42
+
43
+ return $loader;
44
+ }
45
+ }
46
+
47
+ function composerRequire0d7371c5917637133046e0ff54bddc2c($file)
48
+ {
49
+ require $file;
50
+ }
vendor/composer/autoload_real_52.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real_52.php generated by xrstf/composer-php52
4
+
5
+ class ComposerAutoloaderInitcb51162ef6e25f026ad6e42d5cb3b865 {
6
+ private static $loader;
7
+
8
+ public static function loadClassLoader($class) {
9
+ if ('xrstf_Composer52_ClassLoader' === $class) {
10
+ require dirname(__FILE__).'/ClassLoader52.php';
11
+ }
12
+ }
13
+
14
+ /**
15
+ * @return xrstf_Composer52_ClassLoader
16
+ */
17
+ public static function getLoader() {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInitcb51162ef6e25f026ad6e42d5cb3b865', 'loadClassLoader'), true /*, true */);
23
+ self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitcb51162ef6e25f026ad6e42d5cb3b865', 'loadClassLoader'));
25
+
26
+ $vendorDir = dirname(dirname(__FILE__));
27
+ $baseDir = dirname($vendorDir);
28
+ $dir = dirname(__FILE__);
29
+
30
+ $map = require $dir.'/autoload_namespaces.php';
31
+ foreach ($map as $namespace => $path) {
32
+ $loader->add($namespace, $path);
33
+ }
34
+
35
+ $classMap = require $dir.'/autoload_classmap.php';
36
+ if ($classMap) {
37
+ $loader->addClassMap($classMap);
38
+ }
39
+
40
+ $loader->register(true);
41
+
42
+ return $loader;
43
+ }
44
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "composer/installers",
4
+ "version": "v1.0.20",
5
+ "version_normalized": "1.0.20.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/composer/installers.git",
9
+ "reference": "1bff8aa77a18f3616f468ed8000cf86a5725bac3"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/composer/installers/zipball/1bff8aa77a18f3616f468ed8000cf86a5725bac3",
14
+ "reference": "1bff8aa77a18f3616f468ed8000cf86a5725bac3",
15
+ "shasum": ""
16
+ },
17
+ "replace": {
18
+ "roundcube/plugin-installer": "*",
19
+ "shama/baton": "*"
20
+ },
21
+ "require-dev": {
22
+ "composer/composer": "1.0.*@dev",
23
+ "phpunit/phpunit": "4.1.*"
24
+ },
25
+ "time": "2015-01-11 03:51:11",
26
+ "type": "composer-installer",
27
+ "extra": {
28
+ "class": "Composer\\Installers\\Installer",
29
+ "branch-alias": {
30
+ "dev-master": "1.0-dev"
31
+ }
32
+ },
33
+ "installation-source": "dist",
34
+ "autoload": {
35
+ "psr-0": {
36
+ "Composer\\Installers\\": "src/"
37
+ }
38
+ },
39
+ "notification-url": "https://packagist.org/downloads/",
40
+ "license": [
41
+ "MIT"
42
+ ],
43
+ "authors": [
44
+ {
45
+ "name": "Kyle Robinson Young",
46
+ "email": "kyle@dontkry.com",
47
+ "homepage": "https://github.com/shama"
48
+ }
49
+ ],
50
+ "description": "A multi-framework Composer library installer",
51
+ "homepage": "http://composer.github.com/installers/",
52
+ "keywords": [
53
+ "Craft",
54
+ "Dolibarr",
55
+ "Hurad",
56
+ "MODX Evo",
57
+ "OXID",
58
+ "SMF",
59
+ "Thelia",
60
+ "WolfCMS",
61
+ "agl",
62
+ "annotatecms",
63
+ "bitrix",
64
+ "cakephp",
65
+ "chef",
66
+ "codeigniter",
67
+ "concrete5",
68
+ "croogo",
69
+ "dokuwiki",
70
+ "drupal",
71
+ "elgg",
72
+ "fuelphp",
73
+ "grav",
74
+ "installer",
75
+ "joomla",
76
+ "kohana",
77
+ "laravel",
78
+ "lithium",
79
+ "magento",
80
+ "mako",
81
+ "mediawiki",
82
+ "modulework",
83
+ "moodle",
84
+ "phpbb",
85
+ "piwik",
86
+ "ppi",
87
+ "puppet",
88
+ "roundcube",
89
+ "shopware",
90
+ "silverstripe",
91
+ "symfony",
92
+ "typo3",
93
+ "wordpress",
94
+ "zend",
95
+ "zikula"
96
+ ]
97
+ },
98
+ {
99
+ "name": "xrstf/composer-php52",
100
+ "version": "v1.0.17",
101
+ "version_normalized": "1.0.17.0",
102
+ "source": {
103
+ "type": "hg",
104
+ "url": "https://bitbucket.org/xrstf/composer-php52",
105
+ "reference": "70b853668d6c3f97b63dafcfaeebb622bf08fd30"
106
+ },
107
+ "dist": {
108
+ "type": "zip",
109
+ "url": "https://bitbucket.org/xrstf/composer-php52/get/70b853668d6c3f97b63dafcfaeebb622bf08fd30.zip",
110
+ "reference": "70b853668d6c3f97b63dafcfaeebb622bf08fd30",
111
+ "shasum": ""
112
+ },
113
+ "time": "2015-02-01 14:28:15",
114
+ "type": "library",
115
+ "extra": {
116
+ "branch-alias": {
117
+ "dev-default": "1.x-dev"
118
+ }
119
+ },
120
+ "installation-source": "dist",
121
+ "autoload": {
122
+ "psr-0": {
123
+ "xrstf\\Composer52": "lib/"
124
+ }
125
+ },
126
+ "notification-url": "https://packagist.org/downloads/",
127
+ "license": [
128
+ "MIT"
129
+ ],
130
+ "homepage": "http://www.xrstf.de/"
131
+ },
132
+ {
133
+ "name": "yoast/api-libs",
134
+ "version": "dev-trunk",
135
+ "version_normalized": "9999999-dev",
136
+ "source": {
137
+ "type": "git",
138
+ "url": "https://github.com/Yoast/api-libs.git",
139
+ "reference": "0bbe785c5ef52459acc56730d74d01c0fb4d14ac"
140
+ },
141
+ "dist": {
142
+ "type": "zip",
143
+ "url": "https://api.github.com/repos/Yoast/api-libs/zipball/0bbe785c5ef52459acc56730d74d01c0fb4d14ac",
144
+ "reference": "0bbe785c5ef52459acc56730d74d01c0fb4d14ac",
145
+ "shasum": ""
146
+ },
147
+ "time": "2015-02-17 14:41:34",
148
+ "type": "library",
149
+ "installation-source": "source",
150
+ "autoload": {
151
+ "classmap": [
152
+ "class-api-libs.php"
153
+ ]
154
+ },
155
+ "notification-url": "https://packagist.org/downloads/",
156
+ "license": [
157
+ "GPL-3.0"
158
+ ],
159
+ "authors": [
160
+ {
161
+ "name": "Team Yoast",
162
+ "email": "support@yoast.com",
163
+ "homepage": "https://yoast.com"
164
+ }
165
+ ],
166
+ "description": "Shared API libraries for Yoast projects.",
167
+ "homepage": "https://github.com/Yoast/api-libs",
168
+ "keywords": [
169
+ "wordpress"
170
+ ]
171
+ },
172
+ {
173
+ "name": "yoast/i18n-module",
174
+ "version": "dev-master",
175
+ "version_normalized": "9999999-dev",
176
+ "source": {
177
+ "type": "git",
178
+ "url": "https://github.com/Yoast/i18n-module.git",
179
+ "reference": "b391683ca3e0a714c1c8bede8cf5e32c48274216"
180
+ },
181
+ "dist": {
182
+ "type": "zip",
183
+ "url": "https://api.github.com/repos/Yoast/i18n-module/zipball/b391683ca3e0a714c1c8bede8cf5e32c48274216",
184
+ "reference": "b391683ca3e0a714c1c8bede8cf5e32c48274216",
185
+ "shasum": ""
186
+ },
187
+ "time": "2015-01-29 09:52:51",
188
+ "type": "library",
189
+ "installation-source": "source",
190
+ "autoload": {
191
+ "classmap": [
192
+ "i18n-module.php"
193
+ ]
194
+ },
195
+ "notification-url": "https://packagist.org/downloads/",
196
+ "license": [
197
+ "GPL-2.0+"
198
+ ],
199
+ "authors": [
200
+ {
201
+ "name": "Team Yoast",
202
+ "email": "support@yoast.com",
203
+ "homepage": "https://yoast.com"
204
+ }
205
+ ],
206
+ "description": "Handle i18n for WordPress plugins.",
207
+ "homepage": "https://github.com/Yoast/i18n-module",
208
+ "keywords": [
209
+ "wordpress"
210
+ ]
211
+ },
212
+ {
213
+ "name": "yoast/license-manager",
214
+ "version": "dev-master",
215
+ "version_normalized": "9999999-dev",
216
+ "source": {
217
+ "type": "git",
218
+ "url": "https://github.com/Yoast/License-Manager.git",
219
+ "reference": "590ec054383c5e609c78cd4aee03bc8e9d9742cc"
220
+ },
221
+ "dist": {
222
+ "type": "zip",
223
+ "url": "https://api.github.com/repos/Yoast/License-Manager/zipball/590ec054383c5e609c78cd4aee03bc8e9d9742cc",
224
+ "reference": "590ec054383c5e609c78cd4aee03bc8e9d9742cc",
225
+ "shasum": ""
226
+ },
227
+ "time": "2015-01-19 09:14:58",
228
+ "type": "library",
229
+ "installation-source": "source",
230
+ "autoload": {
231
+ "classmap": [
232
+ "class-api-request.php",
233
+ "class-license-manager.php",
234
+ "class-plugin-license-manager.php",
235
+ "class-plugin-update-manager.php",
236
+ "class-product.php",
237
+ "class-theme-license-manager.php",
238
+ "class-theme-update-manager.php",
239
+ "class-update-manager.php"
240
+ ]
241
+ },
242
+ "notification-url": "https://packagist.org/downloads/",
243
+ "license": [
244
+ "GPL-2.0+"
245
+ ],
246
+ "authors": [
247
+ {
248
+ "name": "Team Yoast",
249
+ "email": "support@yoast.com",
250
+ "homepage": "https://yoast.com"
251
+ }
252
+ ],
253
+ "description": "Yoast License Manager.",
254
+ "homepage": "https://github.com/Yoast/License-Manager",
255
+ "keywords": [
256
+ "wordpress"
257
+ ]
258
+ }
259
+ ]
vendor/composer/installers/.editorconfig ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ vendor/
2
+ composer.lock
3
+ .idea/
vendor/composer/installers/.travis.yml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+
3
+ php:
4
+ - 5.3
5
+ - 5.4
6
+ - 5.5
7
+ - 5.6
8
+ - hhvm
9
+
10
+ before_script:
11
+ - curl -s http://getcomposer.org/installer | php -- --quiet
12
+ - php composer.phar install --dev
13
+
14
+ script: phpunit
vendor/composer/installers/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ | Asgard | `asgard-module`<br>`asgard-theme`
37
+ | AGL | `agl-module`
38
+ | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
39
+ | Bitrix | `bitrix-module`<br>`bitrix-component`<br>`bitrix-theme`
40
+ | CakePHP 2+ | **`cakephp-plugin`**
41
+ | Chef | `chef-cookbook`<br>`chef-role`
42
+ | CCFramework | `ccframework-ship`<br>`ccframework-theme`
43
+ | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
44
+ | concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
45
+ | Craft | `craft-plugin`
46
+ | Croogo | `croogo-plugin`<br>`croogo-theme`
47
+ | DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
48
+ | Dolibarr | `dolibarr-module`
49
+ | Drupal | <b>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
50
+ | Elgg | `elgg-plugin`
51
+ | FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
52
+ | FuelPHP v2.x | `fuelphp-component`
53
+ | Grav | `grav-plugin`<br>`grav-theme`
54
+ | Hurad | `hurad-plugin`<br>`hurad-theme`
55
+ | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
56
+ | Kirby | **`kirby-plugin`**
57
+ | Kohana | **`kohana-module`**
58
+ | Laravel | `laravel-library`
59
+ | Lithium | **`lithium-library`<br>`lithium-source`**
60
+ | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
61
+ | Mako | `mako-package`
62
+ | MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
63
+ | MediaWiki | `mediawiki-extension`
64
+ | October | **`october-module`<br>`october-plugin`<br>`october-theme`**
65
+ | OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
66
+ | MODULEWork | `modulework-module`
67
+ | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
68
+ | Piwik | `piwik-plugin`
69
+ | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
70
+ | Pimcore | `pimcore-plugin`
71
+ | PPI | **`ppi-module`**
72
+ | Puppet | `puppet-module`
73
+ | REDAXO | `redaxo-addon`
74
+ | Roundcube | `roundcube-plugin`
75
+ | shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`
76
+ | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
77
+ | SMF | `smf-module`<br>`smf-theme`
78
+ | symfony1 | **`symfony1-plugin`**
79
+ | Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
80
+ | 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`
81
+ | TYPO3 CMS | `typo3-cms-extension`
82
+ | Wolf CMS | `wolfcms-plugin`
83
+ | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
84
+ | Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
85
+ | Zikula | `zikula-module`<br>`zikula-theme`
86
+
87
+ ## Example `composer.json` File
88
+
89
+ This is an example for a CakePHP plugin. The only important parts to set in your
90
+ composer.json file are `"type": "cakephp-plugin"` which describes what your
91
+ package is and `"require": { "composer/installers": "~1.0" }` which tells composer
92
+ to load the custom installers.
93
+
94
+ ```json
95
+ {
96
+ "name": "you/ftp",
97
+ "type": "cakephp-plugin",
98
+ "require": {
99
+ "composer/installers": "~1.0"
100
+ }
101
+ }
102
+ ```
103
+
104
+ This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
105
+ when a user runs `php composer.phar install`.
106
+
107
+ So submit your packages to [packagist.org](http://packagist.org)!
108
+
109
+ ## Custom Install Paths
110
+
111
+ If you are consuming a package that uses the `composer/installers` you can
112
+ override the install path with the following extra in your `composer.json`:
113
+
114
+ ```json
115
+ {
116
+ "extra": {
117
+ "installer-paths": {
118
+ "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ A package type can have a custom installation path with a `type:` prefix.
125
+
126
+ ``` json
127
+ {
128
+ "extra": {
129
+ "installer-paths": {
130
+ "your/custom/path/{$name}/": ["type:wordpress-plugin"]
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ This would use your custom path for each of the listed packages. The available
137
+ variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
138
+
139
+ ## Custom Install Names
140
+
141
+ If you're a package author and need your package to be named differently when
142
+ installed consider using the `installer-name` extra.
143
+
144
+ For example you have a package named `shama/cakephp-ftp` with the type
145
+ `cakephp-plugin`. Installing with `composer/installers` would install to the
146
+ path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
147
+ package author actually need the package to be named and installed to
148
+ `Plugin/Ftp`. Using the following config within your **package** `composer.json`
149
+ will allow this:
150
+
151
+ ```json
152
+ {
153
+ "name": "shama/cakephp-ftp",
154
+ "type": "cakephp-plugin",
155
+ "extra": {
156
+ "installer-name": "Ftp"
157
+ }
158
+ }
159
+ ```
160
+
161
+ Please note the name entered into `installer-name` will be the final and will
162
+ not be inflected.
163
+
164
+ ## Contribute!
165
+
166
+ * [Fork and clone](https://help.github.com/articles/fork-a-repo).
167
+ * Run the command `php composer.phar install --dev` to install the dev
168
+ dependencies. See [Composer](https://github.com/composer/composer#installation--usage).
169
+ * Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
170
+ * Create a branch, commit, push and send us a
171
+ [pull request](https://help.github.com/articles/using-pull-requests).
172
+
173
+ To ensure a consistent code base, you should make sure the code follows the
174
+ [Coding Standards](http://symfony.com/doc/2.0/contributing/code/standards.html)
175
+ which we borrowed from Symfony.
176
+
177
+ If you would like to help, please take a look at the list of
178
+ [issues](https://github.com/composer/installers/issues).
179
+
180
+ ### Should we allow dynamic package types or paths? No.
181
+ What are they? The ability for a package author to determine where a package
182
+ will be installed either through setting the path directly in their
183
+ `composer.json` or through a dynamic package type: `"type":
184
+ "framework-install-here"`.
185
+
186
+ It has been proposed many times. Even implemented once early on and then
187
+ removed. `installers` won't do this because it would allow a single package
188
+ author to wipe out entire folders without the user's consent. That user would
189
+ then come here to yell at us.
vendor/composer/installers/composer.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "composer/installers",
3
+ "type": "composer-installer",
4
+ "license": "MIT",
5
+ "description": "A multi-framework Composer library installer",
6
+ "keywords": [
7
+ "installer",
8
+ "AGL",
9
+ "AnnotateCms",
10
+ "Bitrix",
11
+ "CakePHP",
12
+ "Chef",
13
+ "CodeIgniter",
14
+ "concrete5",
15
+ "Craft",
16
+ "Croogo",
17
+ "DokuWiki",
18
+ "Dolibarr",
19
+ "Drupal",
20
+ "Elgg",
21
+ "FuelPHP",
22
+ "Grav",
23
+ "Hurad",
24
+ "Joomla",
25
+ "Kohana",
26
+ "Laravel",
27
+ "Lithium",
28
+ "Magento",
29
+ "Mako",
30
+ "MODX Evo",
31
+ "MediaWiki",
32
+ "OXID",
33
+ "MODULEWork",
34
+ "Moodle",
35
+ "Piwik",
36
+ "phpBB",
37
+ "PPI",
38
+ "Puppet",
39
+ "Roundcube",
40
+ "shopware",
41
+ "SilverStripe",
42
+ "SMF",
43
+ "symfony",
44
+ "Thelia",
45
+ "TYPO3",
46
+ "WolfCMS",
47
+ "WordPress",
48
+ "Zend",
49
+ "Zikula"
50
+ ],
51
+ "homepage": "http://composer.github.com/installers/",
52
+ "authors": [
53
+ {
54
+ "name": "Kyle Robinson Young",
55
+ "email": "kyle@dontkry.com",
56
+ "homepage": "https://github.com/shama"
57
+ }
58
+ ],
59
+ "autoload": {
60
+ "psr-0": { "Composer\\Installers\\": "src/" }
61
+ },
62
+ "extra": {
63
+ "class": "Composer\\Installers\\Installer",
64
+ "branch-alias": {
65
+ "dev-master": "1.0-dev"
66
+ }
67
+ },
68
+ "replace": {
69
+ "shama/baton": "*",
70
+ "roundcube/plugin-installer": "*"
71
+ },
72
+ "require-dev": {
73
+ "composer/composer": "1.0.*@dev",
74
+ "phpunit/phpunit": "4.1.*"
75
+ }
76
+ }
vendor/composer/installers/phpunit.xml.dist ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AglInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'More/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
16
+ return strtoupper($matches[1]);
17
+ }, $vars['name']);
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AnnotateCmsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'addons/modules/{$name}/',
8
+ 'component' => 'addons/components/{$name}/',
9
+ 'service' => 'addons/services/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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'] = ucfirst(preg_replace('/-module/', '', $vars['name']));
35
+
36
+ return $vars;
37
+ }
38
+
39
+ protected function inflectThemeVars($vars)
40
+ {
41
+ $vars['name'] = ucfirst(preg_replace('/-theme$/', '', $vars['name']));
42
+
43
+ return $vars;
44
+ }
45
+ }
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Composer;
5
+ use Composer\Package\PackageInterface;
6
+
7
+ abstract class BaseInstaller
8
+ {
9
+ protected $locations = array();
10
+ protected $composer;
11
+ protected $package;
12
+
13
+ /**
14
+ * Initializes base installer.
15
+ *
16
+ * @param PackageInterface $package
17
+ * @param Composer $composer
18
+ */
19
+ public function __construct(PackageInterface $package = null, Composer $composer = null)
20
+ {
21
+ $this->composer = $composer;
22
+ $this->package = $package;
23
+ }
24
+
25
+ /**
26
+ * Return the install path based on package type.
27
+ *
28
+ * @param PackageInterface $package
29
+ * @param string $frameworkType
30
+ * @return string
31
+ */
32
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
33
+ {
34
+ $type = $this->package->getType();
35
+
36
+ $prettyName = $this->package->getPrettyName();
37
+ if (strpos($prettyName, '/') !== false) {
38
+ list($vendor, $name) = explode('/', $prettyName);
39
+ } else {
40
+ $vendor = '';
41
+ $name = $prettyName;
42
+ }
43
+
44
+ $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
45
+
46
+ $extra = $package->getExtra();
47
+ if (!empty($extra['installer-name'])) {
48
+ $availableVars['name'] = $extra['installer-name'];
49
+ }
50
+
51
+ if ($this->composer->getPackage()) {
52
+ $extra = $this->composer->getPackage()->getExtra();
53
+ if (!empty($extra['installer-paths'])) {
54
+ $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type);
55
+ if ($customPath !== false) {
56
+ return $this->templatePath($customPath, $availableVars);
57
+ }
58
+ }
59
+ }
60
+
61
+ $packageType = substr($type, strlen($frameworkType) + 1);
62
+ $locations = $this->getLocations();
63
+ if (!isset($locations[$packageType])) {
64
+ throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
65
+ }
66
+
67
+ return $this->templatePath($locations[$packageType], $availableVars);
68
+ }
69
+
70
+ /**
71
+ * For an installer to override to modify the vars per installer.
72
+ *
73
+ * @param array $vars
74
+ * @return array
75
+ */
76
+ public function inflectPackageVars($vars)
77
+ {
78
+ return $vars;
79
+ }
80
+
81
+ /**
82
+ * Gets the installer's locations
83
+ *
84
+ * @return array
85
+ */
86
+ public function getLocations()
87
+ {
88
+ return $this->locations;
89
+ }
90
+
91
+ /**
92
+ * Replace vars in a path
93
+ *
94
+ * @param string $path
95
+ * @param array $vars
96
+ * @return string
97
+ */
98
+ protected function templatePath($path, array $vars = array())
99
+ {
100
+ if (strpos($path, '{') !== false) {
101
+ extract($vars);
102
+ preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
103
+ if (!empty($matches[1])) {
104
+ foreach ($matches[1] as $var) {
105
+ $path = str_replace('{$' . $var . '}', $$var, $path);
106
+ }
107
+ }
108
+ }
109
+
110
+ return $path;
111
+ }
112
+
113
+ /**
114
+ * Search through a passed paths array for a custom install path.
115
+ *
116
+ * @param array $paths
117
+ * @param string $name
118
+ * @param string $type
119
+ * @return string
120
+ */
121
+ protected function mapCustomInstallPaths(array $paths, $name, $type)
122
+ {
123
+ foreach ($paths as $path => $names) {
124
+ if (in_array($name, $names) || in_array('type:' . $type, $names)) {
125
+ return $path;
126
+ }
127
+ }
128
+
129
+ return false;
130
+ }
131
+ }
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class BitrixInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'local/modules/{$name}/',
8
+ 'component' => 'local/components/{$name}/',
9
+ 'theme' => 'local/templates/{$name}/'
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\DependencyResolver\Pool;
5
+ use Composer\Package\PackageInterface;
6
+ use Composer\Package\LinkConstraint\MultiConstraint;
7
+ use Composer\Package\LinkConstraint\VersionConstraint;
8
+
9
+ class CakePHPInstaller extends BaseInstaller
10
+ {
11
+ protected $locations = array(
12
+ 'plugin' => 'Plugin/{$name}/',
13
+ );
14
+
15
+ /**
16
+ * Format package name to CamelCase
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ $nameParts = explode('/', $vars['name']);
21
+ foreach ($nameParts as &$value) {
22
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
23
+ $value = str_replace(array('-', '_'), ' ', $value);
24
+ $value = str_replace(' ', '', ucwords($value));
25
+ }
26
+ $vars['name'] = implode('/', $nameParts);
27
+
28
+ return $vars;
29
+ }
30
+
31
+ /**
32
+ * Change the default plugin location when cakephp >= 3.0
33
+ */
34
+ public function getLocations()
35
+ {
36
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
37
+ $this->locations['plugin'] = 'plugins/{$name}/';
38
+ }
39
+ return $this->locations;
40
+ }
41
+
42
+ /**
43
+ * Add installer-name for CakePHP >= 3.0.0
44
+ *
45
+ * @param PackageInterface $package
46
+ * @param string $frameworkType
47
+ * @return string
48
+ */
49
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
50
+ {
51
+ $extra = $package->getExtra();
52
+ if (empty($extra['installer-name']) && $this->matchesCakeVersion('>=', '3.0.0')) {
53
+ $this->setInstallerName($package);
54
+ }
55
+ return parent::getInstallPath($package, $frameworkType);
56
+ }
57
+
58
+ /**
59
+ * Check if CakePHP version matches against a version
60
+ *
61
+ * @param string $matcher
62
+ * @param string $version
63
+ * @return bool
64
+ */
65
+ protected function matchesCakeVersion($matcher, $version)
66
+ {
67
+ $repositoryManager = $this->composer->getRepositoryManager();
68
+ if ($repositoryManager) {
69
+ $repos = $repositoryManager->getLocalRepository();
70
+ if (!$repos) {
71
+ return false;
72
+ }
73
+ $cake3 = new MultiConstraint(array(
74
+ new VersionConstraint($matcher, $version),
75
+ new VersionConstraint('!=', '9999999-dev'),
76
+ ));
77
+ $pool = new Pool('dev');
78
+ $pool->addRepository($repos);
79
+ $packages = $pool->whatProvides('cakephp/cakephp');
80
+ foreach ($packages as $package) {
81
+ $installed = new VersionConstraint('=', $package->getVersion());
82
+ if ($cake3->matches($installed)) {
83
+ return true;
84
+ break;
85
+ }
86
+ }
87
+ }
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * Set installer-name based on namespace for the source path checking in
93
+ * following order:
94
+ *
95
+ * - With only one autoload path the namespace for that path will be used.
96
+ * - With multiple paths if path 'src' exists it's namespace will be used.
97
+ * - With two autoload paths provided, the namespace of path other than
98
+ * 'tests' will be used.
99
+ *
100
+ * No installer-name is set if PSR-4 autoload block is not found or if none
101
+ * of the above conditions are met.
102
+ *
103
+ * @param PackageInterface $package
104
+ */
105
+ protected function setInstallerName(PackageInterface $package)
106
+ {
107
+ $primaryNS = null;
108
+ $autoLoad = $package->getAutoload();
109
+ foreach ($autoLoad as $type => $typeConfig) {
110
+ if ($type !== 'psr-4') {
111
+ continue;
112
+ }
113
+ $count = count($typeConfig);
114
+
115
+ if ($count === 1) {
116
+ $primaryNS = key($typeConfig);
117
+ break;
118
+ }
119
+
120
+ $matches = preg_grep('#^(\./)?src/?$#', $typeConfig);
121
+ if ($matches) {
122
+ $primaryNS = key($matches);
123
+ break;
124
+ }
125
+
126
+ if ($count === 2) {
127
+ reset($typeConfig);
128
+ if (preg_match('#^(\./)?tests/?$#', current($typeConfig))) {
129
+ next($typeConfig);
130
+ }
131
+ $primaryNS = key($typeConfig);
132
+ break;
133
+ }
134
+
135
+ break;
136
+ }
137
+
138
+ if ($primaryNS) {
139
+ $package->setExtra(array(
140
+ 'installer-name' => trim(str_replace('\\', '/', $primaryNS), '/')
141
+ ));
142
+ }
143
+ }
144
+
145
+ }
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ChefInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'cookbook' => 'Chef/{$vendor}/{$name}/',
8
+ 'role' => 'Chef/roles/{$name}/',
9
+ );
10
+ }
11
+
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ClanCatsFrameworkInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ship' => 'CCF/orbit/{$name}/',
8
+ 'theme' => 'CCF/app/themes/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CodeIgniterInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'application/libraries/{$name}/',
8
+ 'third-party' => 'application/third_party/{$name}/',
9
+ 'module' => 'application/modules/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class Concrete5Installer extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'block' => 'blocks/{$name}/',
8
+ 'package' => 'packages/{$name}/',
9
+ 'theme' => 'themes/{$name}/',
10
+ 'update' => 'updates/{$name}/',
11
+ );
12
+ }
vendor/composer/installers/src/Composer/Installers/CraftInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CraftInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'craft/plugins/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CroogoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'Plugin/{$name}/',
8
+ 'theme' => 'View/Themed/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DokuWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'lib/plugins/{$name}/',
8
+ 'template' => 'lib/tpl/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15
+ * or leading dokuwiki_ if present.
16
+ *
17
+ * For package type dokuwiki-template, cut off a trailing '-template' if present.
18
+ *
19
+ */
20
+ public function inflectPackageVars($vars)
21
+ {
22
+
23
+ if ($vars['type'] === 'dokuwiki-plugin') {
24
+ return $this->inflectPluginVars($vars);
25
+ }
26
+
27
+ if ($vars['type'] === 'dokuwiki-template') {
28
+ return $this->inflectTemplateVars($vars);
29
+ }
30
+
31
+ return $vars;
32
+ }
33
+
34
+ protected function inflectPluginVars($vars)
35
+ {
36
+ $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37
+ $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
38
+
39
+ return $vars;
40
+ }
41
+
42
+ protected function inflectTemplateVars($vars)
43
+ {
44
+ $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45
+ $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
46
+
47
+ return $vars;
48
+ }
49
+
50
+ }
vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Class DolibarrInstaller
6
+ *
7
+ * @package Composer\Installers
8
+ * @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
9
+ */
10
+ class DolibarrInstaller extends BaseInstaller
11
+ {
12
+ //TODO: Add support for scripts and themes
13
+ protected $locations = array(
14
+ 'module' => 'htdocs/custom/{$name}/',
15
+ );
16
+ }
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ );
14
+ }
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ElggInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'mod/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'fuel/app/modules/{$name}/',
8
+ 'package' => 'fuel/packages/{$name}/',
9
+ 'theme' => 'fuel/app/themes/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelphpInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/GravInstaller.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/Installer.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Installer\LibraryInstaller;
5
+ use Composer\Package\PackageInterface;
6
+ use Composer\Repository\InstalledRepositoryInterface;
7
+
8
+ class Installer extends LibraryInstaller
9
+ {
10
+ /**
11
+ * Package types to installer class map
12
+ *
13
+ * @var array
14
+ */
15
+ private $supportedTypes = array(
16
+ 'asgard' => 'AsgardInstaller',
17
+ 'agl' => 'AglInstaller',
18
+ 'annotatecms' => 'AnnotateCmsInstaller',
19
+ 'bitrix' => 'BitrixInstaller',
20
+ 'cakephp' => 'CakePHPInstaller',
21
+ 'chef' => 'ChefInstaller',
22
+ 'ccframework' => 'ClanCatsFrameworkInstaller',
23
+ 'codeigniter' => 'CodeIgniterInstaller',
24
+ 'concrete5' => 'Concrete5Installer',
25
+ 'craft' => 'CraftInstaller',
26
+ 'croogo' => 'CroogoInstaller',
27
+ 'dokuwiki' => 'DokuWikiInstaller',
28
+ 'dolibarr' => 'DolibarrInstaller',
29
+ 'drupal' => 'DrupalInstaller',
30
+ 'elgg' => 'ElggInstaller',
31
+ 'fuel' => 'FuelInstaller',
32
+ 'fuelphp' => 'FuelphpInstaller',
33
+ 'grav' => 'GravInstaller',
34
+ 'hurad' => 'HuradInstaller',
35
+ 'joomla' => 'JoomlaInstaller',
36
+ 'kirby' => 'KirbyInstaller',
37
+ 'kohana' => 'KohanaInstaller',
38
+ 'laravel' => 'LaravelInstaller',
39
+ 'lithium' => 'LithiumInstaller',
40
+ 'magento' => 'MagentoInstaller',
41
+ 'mako' => 'MakoInstaller',
42
+ 'mediawiki' => 'MediaWikiInstaller',
43
+ 'microweber' => 'MicroweberInstaller',
44
+ 'modulework' => 'MODULEWorkInstaller',
45
+ 'modxevo' => 'MODXEvoInstaller',
46
+ 'moodle' => 'MoodleInstaller',
47
+ 'october' => 'OctoberInstaller',
48
+ 'oxid' => 'OxidInstaller',
49
+ 'phpbb' => 'PhpBBInstaller',
50
+ 'pimcore' => 'PimcoreInstaller',
51
+ 'piwik' => 'PiwikInstaller',
52
+ 'ppi' => 'PPIInstaller',
53
+ 'puppet' => 'PuppetInstaller',
54
+ 'redaxo' => 'RedaxoInstaller',
55
+ 'roundcube' => 'RoundcubeInstaller',
56
+ 'shopware' => 'ShopwareInstaller',
57
+ 'silverstripe' => 'SilverStripeInstaller',
58
+ 'smf' => 'SMFInstaller',
59
+ 'symfony1' => 'Symfony1Installer',
60
+ 'thelia' => 'TheliaInstaller',
61
+ 'tusk' => 'TuskInstaller',
62
+ 'typo3-cms' => 'TYPO3CmsInstaller',
63
+ 'typo3-flow' => 'TYPO3FlowInstaller',
64
+ 'whmcs' => 'WHMCSInstaller',
65
+ 'wolfcms' => 'WolfCMSInstaller',
66
+ 'wordpress' => 'WordPressInstaller',
67
+ 'zend' => 'ZendInstaller',
68
+ 'zikula' => 'ZikulaInstaller',
69
+ );
70
+
71
+ /**
72
+ * {@inheritDoc}
73
+ */
74
+ public function getInstallPath(PackageInterface $package)
75
+ {
76
+ $type = $package->getType();
77
+ $frameworkType = $this->findFrameworkType($type);
78
+
79
+ if ($frameworkType === false) {
80
+ throw new \InvalidArgumentException(
81
+ 'Sorry the package type of this package is not yet supported.'
82
+ );
83
+ }
84
+
85
+ $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
86
+ $installer = new $class($package, $this->composer);
87
+
88
+ return $installer->getInstallPath($package, $frameworkType);
89
+ }
90
+
91
+ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
92
+ {
93
+ if (!$repo->hasPackage($package)) {
94
+ throw new \InvalidArgumentException('Package is not installed: '.$package);
95
+ }
96
+
97
+ $repo->removePackage($package);
98
+
99
+ $installPath = $this->getInstallPath($package);
100
+ $this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
101
+ }
102
+
103
+ /**
104
+ * {@inheritDoc}
105
+ */
106
+ public function supports($packageType)
107
+ {
108
+ $frameworkType = $this->findFrameworkType($packageType);
109
+
110
+ if ($frameworkType === false) {
111
+ return false;
112
+ }
113
+
114
+ $locationPattern = $this->getLocationPattern($frameworkType);
115
+
116
+ return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
117
+ }
118
+
119
+ /**
120
+ * Finds a supported framework type if it exists and returns it
121
+ *
122
+ * @param string $type
123
+ * @return string
124
+ */
125
+ protected function findFrameworkType($type)
126
+ {
127
+ $frameworkType = false;
128
+
129
+ krsort($this->supportedTypes);
130
+
131
+ foreach ($this->supportedTypes as $key => $val) {
132
+ if ($key === substr($type, 0, strlen($key))) {
133
+ $frameworkType = substr($type, 0, strlen($key));
134
+ break;
135
+ }
136
+ }
137
+
138
+ return $frameworkType;
139
+ }
140
+
141
+ /**
142
+ * Get the second part of the regular expression to check for support of a
143
+ * package type
144
+ *
145
+ * @param string $frameworkType
146
+ * @return string
147
+ */
148
+ protected function getLocationPattern($frameworkType)
149
+ {
150
+ $pattern = false;
151
+ if (!empty($this->supportedTypes[$frameworkType])) {
152
+ $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
153
+ /** @var BaseInstaller $framework */
154
+ $framework = new $frameworkClass(null, $this->composer);
155
+ $locations = array_keys($framework->getLocations());
156
+ $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
157
+ }
158
+
159
+ return $pattern ? : '(\w+)';
160
+ }
161
+ }
vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/KirbyInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KirbyInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'site/plugins/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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/LaravelInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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/LithiumInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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/MakoInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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/MediaWikiInstaller.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/MoodleInstaller.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ 'tool' => 'admin/tool/{$name}/',
10
+ 'assignment' => 'mod/assignment/type/{$name}/',
11
+ 'assignsubmission' => 'mod/assign/submission/{$name}/',
12
+ 'assignfeedback' => 'mod/assign/feedback/{$name}/',
13
+ 'auth' => 'auth/{$name}/',
14
+ 'availability' => 'availability/condition/{$name}/',
15
+ 'block' => 'blocks/{$name}/',
16
+ 'calendartype' => 'calendar/type/{$name}/',
17
+ 'format' => 'course/format/{$name}/',
18
+ 'coursereport' => 'course/report/{$name}/',
19
+ 'datafield' => 'mod/data/field/{$name}/',
20
+ 'datapreset' => 'mod/data/preset/{$name}/',
21
+ 'editor' => 'lib/editor/{$name}/',
22
+ 'enrol' => 'enrol/{$name}/',
23
+ 'filter' => 'filter/{$name}/',
24
+ 'gradeexport' => 'grade/export/{$name}/',
25
+ 'gradeimport' => 'grade/import/{$name}/',
26
+ 'gradereport' => 'grade/report/{$name}/',
27
+ 'gradingform' => 'grade/grading/form/{$name}/',
28
+ 'local' => 'local/{$name}/',
29
+ 'message' => 'message/output/{$name}/',
30
+ 'plagiarism' => 'plagiarism/{$name}/',
31
+ 'portfolio' => 'portfolio/{$name}/',
32
+ 'qbehaviour' => 'question/behaviour/{$name}/',
33
+ 'qformat' => 'question/format/{$name}/',
34
+ 'qtype' => 'question/type/{$name}/',
35
+ 'quizaccess' => 'mod/quiz/accessrule/{$name}/',
36
+ 'quiz' => 'mod/quiz/report/{$name}/',
37
+ 'report' => 'report/{$name}/',
38
+ 'repository' => 'repository/{$name}/',
39
+ 'scormreport' => 'mod/scorm/report/{$name}/',
40
+ 'theme' => 'theme/{$name}/',
41
+ 'profilefield' => 'user/profile/field/{$name}/',
42
+ 'webservice' => 'webservice/{$name}/',
43
+ 'workshopallocation' => 'mod/workshop/allocation/{$name}/',
44
+ 'workshopeval' => 'mod/workshop/eval/{$name}/',
45
+ 'workshopform' => 'mod/workshop/form/{$name}/'
46
+ );
47
+ }
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('/-plugin$/', '', $vars['name']);
36
+
37
+ return $vars;
38
+ }
39
+
40
+ protected function inflectThemeVars($vars)
41
+ {
42
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
43
+
44
+ return $vars;
45
+ }
46
+ }
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class OxidInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'theme' => 'application/views/{$name}/',
9
+ 'out' => 'out/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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/PhpBBInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/PuppetInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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/RedaxoInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ );
16
+
17
+ /**
18
+ * Transforms the names
19
+ * @param array $vars
20
+ * @return array
21
+ */
22
+ public function inflectPackageVars($vars)
23
+ {
24
+ if ($vars['type'] === 'shopware-theme') {
25
+ return $this->correctThemeName($vars);
26
+ } else {
27
+ return $this->correctPluginName($vars);
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Changes the name to a camelcased combination of vendor and name
33
+ * @param array $vars
34
+ * @return array
35
+ */
36
+ private function correctPluginName($vars)
37
+ {
38
+ $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
39
+ return strtoupper($matches[0][1]);
40
+ }, $vars['name']);
41
+
42
+ $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
43
+
44
+ return $vars;
45
+ }
46
+
47
+ /**
48
+ * Changes the name to a underscore separated name
49
+ * @param array $vars
50
+ * @return array
51
+ */
52
+ private function correctThemeName($vars)
53
+ {
54
+ $vars['name'] = str_replace('-', '_', $vars['name']);
55
+
56
+ return $vars;
57
+ }
58
+ }
vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ } else {
32
+ return parent::getInstallPath($package, $frameworkType);
33
+ }
34
+
35
+ }
36
+ }
vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Extension installer for TYPO3 CMS
6
+ *
7
+ * @author Sascha Egerer <sascha.egerer@dkd.de>
8
+ */
9
+ class TYPO3CmsInstaller extends BaseInstaller
10
+ {
11
+ protected $locations = array(
12
+ 'extension' => 'typo3conf/ext/{$name}/',
13
+ );
14
+ }
vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/WHMCSInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/ZendInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\AsgardInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+
8
+ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var OctoberInstaller
12
+ */
13
+ private $installer;
14
+
15
+ public function setUp()
16
+ {
17
+ $this->installer = new AsgardInstaller(
18
+ new Package('NyanCat', '4.2', '4.2'),
19
+ new Composer()
20
+ );
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
+ 'asgard-module',
39
+ 'asgard-module',
40
+ 'Asgard'
41
+ ),
42
+ array(
43
+ 'asgard-module',
44
+ 'blog',
45
+ 'Blog'
46
+ ),
47
+ // tests that exactly one '-theme' is cut off
48
+ array(
49
+ 'asgard-theme',
50
+ 'some-theme-theme',
51
+ 'Some-theme',
52
+ ),
53
+ // tests that names without '-theme' suffix stay valid
54
+ array(
55
+ 'asgard-theme',
56
+ 'someothertheme',
57
+ 'Someothertheme',
58
+ ),
59
+ );
60
+ }
61
+ }
vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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\Link;
10
+ use Composer\Package\Version\VersionParser;
11
+ use Composer\Composer;
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
+ }
29
+
30
+ /**
31
+ * testInflectPackageVars
32
+ *
33
+ * @return void
34
+ */
35
+ public function testInflectPackageVars()
36
+ {
37
+ $installer = new CakePHPInstaller($this->package, $this->composer);
38
+ $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
39
+ $this->assertEquals($result, array('name' => 'CamelCased'));
40
+
41
+ $installer = new CakePHPInstaller($this->package, $this->composer);
42
+ $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
43
+ $this->assertEquals($result, array('name' => 'WithDash'));
44
+
45
+ $installer = new CakePHPInstaller($this->package, $this->composer);
46
+ $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
47
+ $this->assertEquals($result, array('name' => 'WithUnderscore'));
48
+
49
+ $installer = new CakePHPInstaller($this->package, $this->composer);
50
+ $result = $installer->inflectPackageVars(array('name' => 'cake/acl'));
51
+ $this->assertEquals($result, array('name' => 'Cake/Acl'));
52
+
53
+ $installer = new CakePHPInstaller($this->package, $this->composer);
54
+ $result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit'));
55
+ $this->assertEquals($result, array('name' => 'Cake/DebugKit'));
56
+ }
57
+
58
+ /**
59
+ * Test getLocations returning appropriate values based on CakePHP version
60
+ *
61
+ */
62
+ public function testGetLocations() {
63
+ $package = new RootPackage('CamelCased', '1.0', '1.0');
64
+ $composer = new Composer();
65
+ $rm = new RepositoryManager(
66
+ $this->getMock('Composer\IO\IOInterface'),
67
+ $this->getMock('Composer\Config')
68
+ );
69
+ $composer->setRepositoryManager($rm);
70
+ $installer = new CakePHPInstaller($package, $composer);
71
+
72
+ // 2.0 < cakephp < 3.0
73
+ $this->setCakephpVersion($rm, '2.0.0');
74
+ $result = $installer->getLocations();
75
+ $this->assertContains('Plugin/', $result['plugin']);
76
+
77
+ $this->setCakephpVersion($rm, '2.5.9');
78
+ $result = $installer->getLocations();
79
+ $this->assertContains('Plugin/', $result['plugin']);
80
+
81
+ $this->setCakephpVersion($rm, '~2.5');
82
+ $result = $installer->getLocations();
83
+ $this->assertContains('Plugin/', $result['plugin']);
84
+
85
+ // special handling for 2.x versions when 3.x is still in development
86
+ $this->setCakephpVersion($rm, 'dev-master');
87
+ $result = $installer->getLocations();
88
+ $this->assertContains('Plugin/', $result['plugin']);
89
+
90
+ $this->setCakephpVersion($rm, '>=2.5');
91
+ $result = $installer->getLocations();
92
+ $this->assertContains('Plugin/', $result['plugin']);
93
+
94
+ // cakephp >= 3.0
95
+ $this->setCakephpVersion($rm, '3.0.*-dev');
96
+ $result = $installer->getLocations();
97
+ $this->assertContains('plugins/', $result['plugin']);
98
+
99
+ $this->setCakephpVersion($rm, '~8.8');
100
+ $result = $installer->getLocations();
101
+ $this->assertContains('plugins/', $result['plugin']);
102
+ }
103
+
104
+ /**
105
+ * Test if installer-name was set
106
+ *
107
+ */
108
+ public function testGetInstallPath() {
109
+ $autoload = array(
110
+ 'psr-4' => array(
111
+ 'FOC\\Authenticate' => ''
112
+ )
113
+ );
114
+ $this->package->setAutoload($autoload);
115
+ $this->package->setType('cakephp-plugin');
116
+ $rm = new RepositoryManager(
117
+ $this->getMock('Composer\IO\IOInterface'),
118
+ $this->getMock('Composer\Config')
119
+ );
120
+ $this->composer->setRepositoryManager($rm);
121
+ $installer = new CakePHPInstaller($this->package, $this->composer);
122
+
123
+ $this->setCakephpVersion($rm, '3.0.0');
124
+ $installer->getInstallPath($this->package, 'cakephp');
125
+ $extra = $this->package->getExtra();
126
+ $this->assertEquals('FOC/Authenticate', $extra['installer-name']);
127
+
128
+ $autoload = array(
129
+ 'psr-4' => array(
130
+ 'FOC\Acl\Test' => './tests',
131
+ 'FOC\Acl' => ''
132
+ )
133
+ );
134
+ $this->package->setAutoload($autoload);
135
+ $this->package->setExtra(array());
136
+ $installer->getInstallPath($this->package, 'cakephp');
137
+ $extra = $this->package->getExtra();
138
+ $this->assertEquals('FOC/Acl', $extra['installer-name']);
139
+
140
+ $autoload = array(
141
+ 'psr-4' => array(
142
+ 'Foo\Bar' => 'foo',
143
+ 'Acme\Plugin\Test' => 'tests',
144
+ 'Acme\Plugin' => './src'
145
+ )
146
+ );
147
+ $this->package->setAutoload($autoload);
148
+ $this->package->setExtra(array());
149
+ $installer->getInstallPath($this->package, 'cakephp');
150
+ $extra = $this->package->getExtra();
151
+ $this->assertEquals('Acme/Plugin', $extra['installer-name']);
152
+ }
153
+
154
+ protected function setCakephpVersion($rm, $version) {
155
+ $parser = new VersionParser();
156
+ list(, $version) = explode(' ', $parser->parseConstraints($version));
157
+ $installed = new InstalledArrayRepository();
158
+ $package = new Package('cakephp/cakephp', $version, $version);
159
+ $installed->addPackage($package);
160
+ $rm->setLocalRepository($installed);
161
+ }
162
+
163
+ }
vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\DokuWikiInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+
8
+ class DokuWikiInstallerTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var DokuWikiInstaller
12
+ */
13
+ private $installer;
14
+
15
+ public function setUp()
16
+ {
17
+ $this->installer = new DokuWikiInstaller(
18
+ new Package('NyanCat', '4.2', '4.2'),
19
+ new Composer()
20
+ );
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
+ 'dokuwiki-plugin',
39
+ 'dokuwiki-test-plugin',
40
+ 'test',
41
+ ),
42
+ array(
43
+ 'dokuwiki-plugin',
44
+ 'test-plugin',
45
+ 'test',
46
+ ),
47
+ array(
48
+ 'dokuwiki-plugin',
49
+ 'dokuwiki_test',
50
+ 'test',
51
+ ),
52
+ array(
53
+ 'dokuwiki-plugin',
54
+ 'test',
55
+ 'test',
56
+ ),
57
+ array(
58
+ 'dokuwiki-plugin',
59
+ 'test-template',
60
+ 'test-template',
61
+ ),
62
+ array(
63
+ 'dokuwiki-template',
64
+ 'dokuwiki-test-template',
65
+ 'test',
66
+ ),
67
+ array(
68
+ 'dokuwiki-template',
69
+ 'test-template',
70
+ 'test',
71
+ ),
72
+ array(
73
+ 'dokuwiki-template',
74
+ 'dokuwiki_test',
75
+ 'test',
76
+ ),
77
+ array(
78
+ 'dokuwiki-template',
79
+ 'test',
80
+ 'test',
81
+ ),
82
+ array(
83
+ 'dokuwiki-template',
84
+ 'test-plugin',
85
+ 'test-plugin',
86
+ ),
87
+ );
88
+ }
89
+ }
vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('annotatecms-module', true),
89
+ array('annotatecms-component', true),
90
+ array('annotatecms-service', true),
91
+ array('bitrix-module', true),
92
+ array('bitrix-component', true),
93
+ array('bitrix-theme', true),
94
+ array('cakephp', false),
95
+ array('cakephp-', false),
96
+ array('cakephp-app', false),
97
+ array('cakephp-plugin', true),
98
+ array('chef-cookbook', true),
99
+ array('chef-role', true),
100
+ array('codeigniter-app', false),
101
+ array('codeigniter-library', true),
102
+ array('codeigniter-third-party', true),
103
+ array('codeigniter-module', true),
104
+ array('concrete5-block', true),
105
+ array('concrete5-package', true),
106
+ array('concrete5-theme', true),
107
+ array('concrete5-update', true),
108
+ array('craft-plugin', true),
109
+ array('croogo-plugin', true),
110
+ array('croogo-theme', true),
111
+ array('dokuwiki-plugin', true),
112
+ array('dokuwiki-template', true),
113
+ array('drupal-module', true),
114
+ array('dolibarr-module', true),
115
+ array('elgg-plugin', true),
116
+ array('fuel-module', true),
117
+ array('fuel-package', true),
118
+ array('fuel-theme', true),
119
+ array('fuelphp-component', true),
120
+ array('hurad-plugin', true),
121
+ array('hurad-theme', true),
122
+ array('joomla-library', true),
123
+ array('kirby-plugin', true),
124
+ array('kohana-module', true),
125
+ array('laravel-library', true),
126
+ array('lithium-library', true),
127
+ array('magento-library', true),
128
+ array('mako-package', true),
129
+ array('modxevo-snippet', true),
130
+ array('modxevo-plugin', true),
131
+ array('modxevo-module', true),
132
+ array('modxevo-template', true),
133
+ array('modxevo-lib', true),
134
+ array('mediawiki-extension', true),
135
+ array('mediawiki-skin', true),
136
+ array('microweber-module', true),
137
+ array('modulework-module', true),
138
+ array('moodle-mod', true),
139
+ array('october-module', true),
140
+ array('october-plugin', true),
141
+ array('piwik-plugin', true),
142
+ array('phpbb-extension', true),
143
+ array('pimcore-plugin', true),
144
+ array('ppi-module', true),
145
+ array('puppet-module', true),
146
+ array('redaxo-addon', true),
147
+ array('redaxo-bestyle-plugin', true),
148
+ array('roundcube-plugin', true),
149
+ array('shopware-backend-plugin', true),
150
+ array('shopware-core-plugin', true),
151
+ array('shopware-frontend-plugin', true),
152
+ array('shopware-theme', true),
153
+ array('silverstripe-module', true),
154
+ array('silverstripe-theme', true),
155
+ array('smf-module', true),
156
+ array('smf-theme', true),
157
+ array('symfony1-plugin', true),
158
+ array('thelia-module', true),
159
+ array('thelia-frontoffice-template', true),
160
+ array('thelia-backoffice-template', true),
161
+ array('thelia-email-template', true),
162
+ array('tusk-task', true),
163
+ array('tusk-asset', true),
164
+ array('typo3-flow-plugin', true),
165
+ array('typo3-cms-extension', true),
166
+ array('whmcs-gateway', true),
167
+ array('wolfcms-plugin', true),
168
+ array('wordpress-plugin', true),
169
+ array('wordpress-core', false),
170
+ array('zend-library', true),
171
+ array('zikula-module', true),
172
+ array('zikula-theme', true),
173
+ );
174
+ }
175
+
176
+ /**
177
+ * testInstallPath
178
+ *
179
+ * @dataProvider dataForTestInstallPath
180
+ */
181
+ public function testInstallPath($type, $path, $name, $version = '1.0.0')
182
+ {
183
+ $installer = new Installer($this->io, $this->composer);
184
+ $package = new Package($name, $version, $version);
185
+
186
+ $package->setType($type);
187
+ $result = $installer->getInstallPath($package);
188
+ $this->assertEquals($path, $result);
189
+ }
190
+
191
+ /**
192
+ * dataFormTestInstallPath
193
+ */
194
+ public function dataForTestInstallPath()
195
+ {
196
+ return array(
197
+ array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
198
+ array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
199
+ array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
200
+ array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
201
+ array('bitrix-module', 'local/modules/my_module/', 'author/my_module'),
202
+ array('bitrix-component', 'local/components/my_component/', 'author/my_component'),
203
+ array('bitrix-theme', 'local/templates/my_theme/', 'author/my_theme'),
204
+ array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
205
+ array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
206
+ array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
207
+ array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
208
+ array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
209
+ array('concrete5-block', 'blocks/concrete5_block/', 'remo/concrete5_block'),
210
+ array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
211
+ array('concrete5-theme', 'themes/concrete5_theme/', 'remo/concrete5_theme'),
212
+ array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),
213
+ array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
214
+ array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
215
+ array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
216
+ array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
217
+ array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
218
+ array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
219
+ array('drupal-module', 'modules/my_module/', 'shama/my_module'),
220
+ array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
221
+ array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
222
+ array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
223
+ array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
224
+ array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
225
+ array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
226
+ array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
227
+ array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
228
+ array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
229
+ array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
230
+ array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
231
+ array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
232
+ array('kohana-module', 'modules/my_package/', 'shama/my_package'),
233
+ array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
234
+ array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
235
+ array('magento-library', 'lib/foo/', 'test/foo'),
236
+ array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),
237
+ array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),
238
+ array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),
239
+ array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),
240
+ array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),
241
+ array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
242
+ array('mediawiki-extension', 'extensions/APC/', 'author/APC'),
243
+ array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),
244
+ array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),
245
+ array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),
246
+ array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),
247
+ array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),
248
+ array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),
249
+ array('modulework-module', 'modules/my_package/', 'shama/my_package'),
250
+ array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
251
+ array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
252
+ array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
253
+ array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
254
+ array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
255
+ array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
256
+ array('phpbb-style', 'styles/foo/', 'test/foo'),
257
+ array('phpbb-language', 'language/foo/', 'test/foo'),
258
+ array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
259
+ array('ppi-module', 'modules/foo/', 'test/foo'),
260
+ array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
261
+ array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
262
+ array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
263
+ array('roundcube-plugin', 'plugins/base/', 'test/base'),
264
+ array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
265
+ array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
266
+ array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
267
+ array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
268
+ array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
269
+ array('silverstripe-module', 'my_module/', 'shama/my_module'),
270
+ array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
271
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
272
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
273
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
274
+ array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
275
+ array('smf-module', 'Sources/my_module/', 'shama/my_module'),
276
+ array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),
277
+ array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
278
+ array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
279
+ array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),
280
+ array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),
281
+ array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),
282
+ array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),
283
+ array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),
284
+ array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
285
+ array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
286
+ array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
287
+ array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
288
+ array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
289
+ array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
290
+ array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
291
+ array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
292
+ array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
293
+ array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
294
+ );
295
+ }
296
+
297
+ /**
298
+ * testGetCakePHPInstallPathException
299
+ *
300
+ * @return void
301
+ *
302
+ * @expectedException \InvalidArgumentException
303
+ */
304
+ public function testGetCakePHPInstallPathException()
305
+ {
306
+ $installer = new Installer($this->io, $this->composer);
307
+ $package = new Package('shama/ftp', '1.0.0', '1.0.0');
308
+
309
+ $package->setType('cakephp-whoops');
310
+ $result = $installer->getInstallPath($package);
311
+ }
312
+
313
+ /**
314
+ * testCustomInstallPath
315
+ */
316
+ public function testCustomInstallPath()
317
+ {
318
+ $installer = new Installer($this->io, $this->composer);
319
+ $package = new Package('shama/ftp', '1.0.0', '1.0.0');
320
+ $package->setType('cakephp-plugin');
321
+ $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
322
+ $this->composer->setPackage($consumerPackage);
323
+ $consumerPackage->setExtra(array(
324
+ 'installer-paths' => array(
325
+ 'my/custom/path/{$name}/' => array(
326
+ 'shama/ftp',
327
+ 'foo/bar',
328
+ ),
329
+ ),
330
+ ));
331
+ $result = $installer->getInstallPath($package);
332
+ $this->assertEquals('my/custom/path/Ftp/', $result);
333
+ }
334
+
335
+ /**
336
+ * testCustomInstallerName
337
+ */
338
+ public function testCustomInstallerName()
339
+ {
340
+ $installer = new Installer($this->io, $this->composer);
341
+ $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
342
+ $package->setType('cakephp-plugin');
343
+ $package->setExtra(array(
344
+ 'installer-name' => 'FTP',
345
+ ));
346
+ $result = $installer->getInstallPath($package);
347
+ $this->assertEquals('Plugin/FTP/', $result);
348
+ }
349
+
350
+ /**
351
+ * testCustomTypePath
352
+ */
353
+ public function testCustomTypePath()
354
+ {
355
+ $installer = new Installer($this->io, $this->composer);
356
+ $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
357
+ $package->setType('wordpress-plugin');
358
+ $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
359
+ $this->composer->setPackage($consumerPackage);
360
+ $consumerPackage->setExtra(array(
361
+ 'installer-paths' => array(
362
+ 'my/custom/path/{$name}/' => array(
363
+ 'type:wordpress-plugin'
364
+ ),
365
+ ),
366
+ ));
367
+ $result = $installer->getInstallPath($package);
368
+ $this->assertEquals('my/custom/path/my_plugin/', $result);
369
+ }
370
+
371
+ /**
372
+ * testNoVendorName
373
+ */
374
+ public function testNoVendorName()
375
+ {
376
+ $installer = new Installer($this->io, $this->composer);
377
+ $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
378
+
379
+ $package->setType('symfony1-plugin');
380
+ $result = $installer->getInstallPath($package);
381
+ $this->assertEquals('plugins/sfPhpunitPlugin/', $result);
382
+ }
383
+
384
+ /**
385
+ * testTypo3Inflection
386
+ */
387
+ public function testTypo3Inflection()
388
+ {
389
+ $installer = new Installer($this->io, $this->composer);
390
+ $package = new Package('typo3/fluid', '1.0.0', '1.0.0');
391
+
392
+ $package->setAutoload(array(
393
+ 'psr-0' => array(
394
+ 'TYPO3\\Fluid' => 'Classes',
395
+ ),
396
+ ));
397
+
398
+ $package->setType('typo3-flow-package');
399
+ $result = $installer->getInstallPath($package);
400
+ $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
401
+ }
402
+
403
+ public function testUninstallAndDeletePackageFromLocalRepo()
404
+ {
405
+ $package = new Package('foo', '1.0.0', '1.0.0');
406
+
407
+ $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
408
+ $installer->expects($this->once())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
409
+
410
+ $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
411
+ $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
412
+ $repo->expects($this->once())->method('removePackage')->with($package);
413
+
414
+ $installer->uninstall($repo, $package);
415
+ }
416
+ }
vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\MediaWikiInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+
8
+ class MediaWikiInstallerTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var MediaWikiInstaller
12
+ */
13
+ private $installer;
14
+
15
+ public function setUp()
16
+ {
17
+ $this->installer = new MediaWikiInstaller(
18
+ new Package('NyanCat', '4.2', '4.2'),
19
+ new Composer()
20
+ );
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
+ 'mediawiki-extension',
39
+ 'sub-page-list',
40
+ 'SubPageList',
41
+ ),
42
+ array(
43
+ 'mediawiki-extension',
44
+ 'sub-page-list-extension',
45
+ 'SubPageList',
46
+ ),
47
+ array(
48
+ 'mediawiki-extension',
49
+ 'semantic-mediawiki',
50
+ 'SemanticMediawiki',
51
+ ),
52
+ // tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions
53
+ array(
54
+ 'mediawiki-skin',
55
+ 'some-skin-skin',
56
+ 'some-skin',
57
+ ),
58
+ // tests that names without '-skin' suffix stay valid
59
+ array(
60
+ 'mediawiki-skin',
61
+ 'someotherskin',
62
+ 'someotherskin',
63
+ ),
64
+ );
65
+ }
66
+ }
vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\OctoberInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+
8
+ class OctoberInstallerTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var OctoberInstaller
12
+ */
13
+ private $installer;
14
+
15
+ public function setUp()
16
+ {
17
+ $this->installer = new OctoberInstaller(
18
+ new Package('NyanCat', '4.2', '4.2'),
19
+ new Composer()
20
+ );
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
+ 'october-plugin',
39
+ 'subpagelist',
40
+ 'subpagelist',
41
+ ),
42
+ array(
43
+ 'october-plugin',
44
+ 'subpagelist-plugin',
45
+ 'subpagelist',
46
+ ),
47
+ array(
48
+ 'october-plugin',
49
+ 'semanticoctober',
50
+ 'semanticoctober',
51
+ ),
52
+ // tests that exactly one '-theme' is cut off
53
+ array(
54
+ 'october-theme',
55
+ 'some-theme-theme',
56
+ 'some-theme',
57
+ ),
58
+ // tests that names without '-theme' suffix stay valid
59
+ array(
60
+ 'october-theme',
61
+ 'someothertheme',
62
+ 'someothertheme',
63
+ ),
64
+ );
65
+ }
66
+ }
vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/TestCase.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
21
+ abstract class TestCase extends \PHPUnit_Framework_TestCase
22
+ {
23
+ private static $parser;
24
+
25
+ protected static function getVersionParser()
26
+ {
27
+ if (!self::$parser) {
28
+ self::$parser = new VersionParser();
29
+ }
30
+
31
+ return self::$parser;
32
+ }
33
+
34
+ protected function getVersionConstraint($operator, $version)
35
+ {
36
+ return new VersionConstraint(
37
+ $operator,
38
+ self::getVersionParser()->normalize($version)
39
+ );
40
+ }
41
+
42
+ protected function getPackage($name, $version)
43
+ {
44
+ $normVersion = self::getVersionParser()->normalize($version);
45
+
46
+ return new Package($name, $normVersion, $version);
47
+ }
48
+
49
+ protected function getAliasPackage($package, $version)
50
+ {
51
+ $normVersion = self::getVersionParser()->normalize($version);
52
+
53
+ return new AliasPackage($package, $normVersion, $version);
54
+ }
55
+
56
+ protected function ensureDirectoryExistsAndClear($directory)
57
+ {
58
+ $fs = new Filesystem();
59
+ if (is_dir($directory)) {
60
+ $fs->removeDirectory($directory);
61
+ }
62
+ mkdir($directory, 0777, true);
63
+ }
64
+ }
vendor/composer/installers/tests/bootstrap.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+
3
+ $loader = require __DIR__ . '/../src/bootstrap.php';
4
+ $loader->add('Composer\Installers\Test', __DIR__);
vendor/xrstf/composer-php52/.hg_archival.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ repo: 0d0ceaca3a0500b3f45b41b79c6ac4f396dc4b13
2
+ node: 70b853668d6c3f97b63dafcfaeebb622bf08fd30
3
+ branch: default
4
+ tag: v1.0.17
vendor/xrstf/composer-php52/.hgtags ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 1328b37f36994039e0482272bfea90825f9b8d4c v1.0.0
2
+ 8ed634e8a47ed96c8c6e7ef3bffb73e69c181f4b v1.0.1
3
+ 8490d268ce216557f2ba82298c8dc7a8233d1c51 v1.0.2
4
+ e719a1afd817bc0c260750d40e871d4a8ea312f2 v1.0.3
5
+ c139ce4683b3f0269ff017a0dc30f964ec165156 v1.0.4
6
+ b8d4df7f5d4441c30bb35c4ab0eea7e7a2710cd4 v1.0.5
7
+ 05d33685ec9a85742d4f1634dcdd2bb8da74f626 v1.0.6
8
+ a1377306c6e40426e3913f46cf5019c9e2497164 v1.0.7
9
+ 77cc535bc7441dacdbc10be7720c44c47b9cc2a2 v1.0.8
10
+ b4e44b96b96762d08366196f7f9013e26c8d610d v1.0.9
11
+ 9b04ae051405d81c85dcb3a307b503a1471ee4fb v1.0.10
12
+ c0b2cd0685c3a35297e3392b3a9df3c51c287740 v1.0.11
13
+ 1d534d45cf037b5f2f83c04043851b5f0f478975 v1.0.12
14
+ eabb654da4d9200180037805cf348c20caf775c2 v1.0.13
15
+ 8cc8f6ceddf527eafd0cd7b4cb274bef39d27a92 v1.0.14
16
+ b69d211ed4885e3c16282b01b7548226c7b50657 v1.0.15
17
+ b80de08b940ea59789646fa20d841fbdd72d72f0 v1.0.16
vendor/xrstf/composer-php52/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2013 Christoph Mewes
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/xrstf/composer-php52/README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PHP 5.2 Autoloading for Composer
2
+ ================================
3
+
4
+ This package provides an easy way to get a PHP 5.2 compatible autoloader out of Composer. The generated autoloader is fully compatible to the original and is written into separate files, each ending with `_52.php`.
5
+
6
+ Usage
7
+ -----
8
+
9
+ In your project's `composer.json`, add the following lines:
10
+
11
+ :::json
12
+ {
13
+ "require": {
14
+ "xrstf/composer-php52": "1.*"
15
+ },
16
+ "scripts": {
17
+ "post-install-cmd": [
18
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
19
+ ],
20
+ "post-update-cmd": [
21
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
22
+ ],
23
+ "post-autoload-dump": [
24
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
25
+ ]
26
+ }
27
+ }
28
+
29
+ After the next update/install, you will have a `vendor/autoload_52.php` file, that you can simply include and use in PHP 5.2 projects.
vendor/xrstf/composer-php52/composer.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "xrstf/composer-php52",
3
+ "license": "MIT",
4
+ "homepage": "http://www.xrstf.de/",
5
+ "support": {
6
+ "source": "https://bitbucket.org/xrstf/composer-php52",
7
+ "issues": "https://bitbucket.org/xrstf/composer-php52/issues"
8
+ },
9
+ "autoload": {
10
+ "psr-0": {
11
+ "xrstf\\Composer52": "lib/"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "post-install-cmd": [
16
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
17
+ ],
18
+ "post-update-cmd": [
19
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
20
+ ]
21
+ },
22
+ "extra": {
23
+ "branch-alias": {
24
+ "dev-default": "1.x-dev"
25
+ }
26
+ }
27
+ }
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ *
12
+ * 99% of this is copied as-is from the original Composer source code and is
13
+ * released under MIT license as well. Copyright goes to:
14
+ *
15
+ * - Igor Wiedler <igor@wiedler.ch>
16
+ * - Jordi Boggiano <j.boggiano@seld.be>
17
+ */
18
+
19
+ namespace xrstf\Composer52;
20
+
21
+ use Composer\Autoload\AutoloadGenerator as BaseGenerator;
22
+ use Composer\Autoload\ClassMapGenerator;
23
+ use Composer\Config;
24
+ use Composer\Installer\InstallationManager;
25
+ use Composer\Package\AliasPackage;
26
+ use Composer\Package\PackageInterface;
27
+ use Composer\Repository\InstalledRepositoryInterface;
28
+ use Composer\Util\Filesystem;
29
+
30
+ class AutoloadGenerator extends BaseGenerator {
31
+ public function __construct() {
32
+ // do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
33
+ }
34
+
35
+ public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
36
+ $filesystem = new Filesystem();
37
+ $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
38
+
39
+ $cwd = getcwd();
40
+ $basePath = $filesystem->normalizePath($cwd);
41
+ $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
42
+ $targetDir = $vendorPath.'/'.$targetDir;
43
+ $filesystem->ensureDirectoryExists($targetDir);
44
+
45
+ $useGlobalIncludePath = (bool) $config->get('use-include-path');
46
+ $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
47
+ $classMapAuthoritative = $config->get('classmap-authoritative');
48
+
49
+ $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
50
+ $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
51
+
52
+ $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
53
+ $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
54
+
55
+ // add 5.2 compat
56
+ $vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
57
+ $vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
58
+
59
+ $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
60
+ $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
61
+
62
+ // add custom psr-0 autoloading if the root package has a target dir
63
+ $targetDirLoader = null;
64
+ $mainAutoload = $mainPackage->getAutoload();
65
+ if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
66
+ $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
67
+ $prefixes = implode(', ', array_map(function ($prefix) {
68
+ return var_export($prefix, true);
69
+ }, array_keys($mainAutoload['psr-0'])));
70
+
71
+ $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
72
+
73
+ $targetDirLoader = <<<EOF
74
+
75
+ public static function autoload(\$class) {
76
+ \$dir = $baseDirFromTargetDirCode.'/';
77
+ \$prefixes = array($prefixes);
78
+
79
+ foreach (\$prefixes as \$prefix) {
80
+ if (0 !== strpos(\$class, \$prefix)) {
81
+ continue;
82
+ }
83
+
84
+ \$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
85
+ \$path = \$dir.implode('/', array_slice(\$path, $levels));
86
+
87
+ if (!\$path = self::resolveIncludePath(\$path)) {
88
+ return false;
89
+ }
90
+
91
+ require \$path;
92
+ return true;
93
+ }
94
+ }
95
+
96
+ EOF;
97
+ }
98
+
99
+ $filesCode = "";
100
+ $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
101
+ foreach ($autoloads['files'] as $functionFile) {
102
+ // don't include file if it is using PHP 5.3+ syntax
103
+ // https://bitbucket.org/xrstf/composer-php52/issue/4
104
+ if ($this->isPHP53($functionFile)) {
105
+ $filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
106
+ }
107
+ else {
108
+ $filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
109
+ }
110
+ }
111
+
112
+ if (!$suffix) {
113
+ $suffix = md5(uniqid('', true));
114
+ }
115
+
116
+ $includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
117
+
118
+ file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
119
+ file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $classMapAuthoritative));
120
+
121
+ // use stream_copy_to_stream instead of copy
122
+ // to work around https://bugs.php.net/bug.php?id=64634
123
+ $sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
124
+ $targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
125
+ stream_copy_to_stream($sourceLoader, $targetLoader);
126
+ fclose($sourceLoader);
127
+ fclose($targetLoader);
128
+ unset($sourceLoader, $targetLoader);
129
+ }
130
+
131
+ protected function isPHP53($file) {
132
+ $tokens = token_get_all(file_get_contents($file));
133
+ $php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
134
+
135
+ // PHP 5.4+
136
+ if (defined('T_TRAIT')) {
137
+ $php53[] = T_TRAIT;
138
+ $php53[] = T_TRAIT_C;
139
+ $php53[] = T_TRAIT_C;
140
+ }
141
+
142
+ // PHP 5.5+
143
+ if (defined('T_FINALLY')) {
144
+ $php53[] = T_FINALLY;
145
+ $php53[] = T_YIELD;
146
+ }
147
+
148
+ foreach ($tokens as $token) {
149
+ if (is_array($token) && in_array($token[0], $php53)) {
150
+ return true;
151
+ }
152
+ }
153
+
154
+ return false;
155
+ }
156
+
157
+ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
158
+ $includePaths = array();
159
+
160
+ foreach ($packageMap as $item) {
161
+ list($package, $installPath) = $item;
162
+
163
+ if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
164
+ $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
165
+ }
166
+
167
+ foreach ($package->getIncludePaths() as $includePath) {
168
+ $includePath = trim($includePath, '/');
169
+ $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
170
+ }
171
+ }
172
+
173
+ if (!$includePaths) {
174
+ return;
175
+ }
176
+
177
+ $includePathsFile = <<<EOF
178
+ <?php
179
+
180
+ // include_paths_52.php generated by xrstf/composer-php52
181
+
182
+ \$vendorDir = $vendorPathCode;
183
+ \$baseDir = $appBaseDirCode;
184
+
185
+ return array(
186
+
187
+ EOF;
188
+
189
+ foreach ($includePaths as $path) {
190
+ $includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
191
+ }
192
+
193
+ return $includePathsFile . ");\n";
194
+ }
195
+
196
+ protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
197
+ return <<<AUTOLOAD
198
+ <?php
199
+
200
+ // autoload_52.php generated by xrstf/composer-php52
201
+
202
+ require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
203
+
204
+ return ComposerAutoloaderInit$suffix::getLoader();
205
+
206
+ AUTOLOAD;
207
+ }
208
+
209
+ protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $classMapAuthoritative) {
210
+ // TODO the class ComposerAutoloaderInit should be revert to a closure
211
+ // when APC has been fixed:
212
+ // - https://github.com/composer/composer/issues/959
213
+ // - https://bugs.php.net/bug.php?id=52144
214
+ // - https://bugs.php.net/bug.php?id=61576
215
+ // - https://bugs.php.net/bug.php?id=59298
216
+
217
+ if ($filesCode) {
218
+ $filesCode = "\n\n".rtrim($filesCode);
219
+ }
220
+
221
+ $file = <<<HEADER
222
+ <?php
223
+
224
+ // autoload_real_52.php generated by xrstf/composer-php52
225
+
226
+ class ComposerAutoloaderInit$suffix {
227
+ private static \$loader;
228
+
229
+ public static function loadClassLoader(\$class) {
230
+ if ('xrstf_Composer52_ClassLoader' === \$class) {
231
+ require dirname(__FILE__).'/ClassLoader52.php';
232
+ }
233
+ }
234
+
235
+ /**
236
+ * @return xrstf_Composer52_ClassLoader
237
+ */
238
+ public static function getLoader() {
239
+ if (null !== self::\$loader) {
240
+ return self::\$loader;
241
+ }
242
+
243
+ spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
244
+ self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
245
+ spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
246
+
247
+ \$vendorDir = $vendorPathCode;
248
+ \$baseDir = $appBaseDirCode;
249
+ \$dir = dirname(__FILE__);
250
+
251
+
252
+ HEADER;
253
+
254
+ if ($useIncludePath) {
255
+ $file .= <<<'INCLUDE_PATH'
256
+ $includePaths = require $dir.'/include_paths.php';
257
+ array_push($includePaths, get_include_path());
258
+ set_include_path(implode(PATH_SEPARATOR, $includePaths));
259
+
260
+
261
+ INCLUDE_PATH;
262
+ }
263
+
264
+ $file .= <<<'PSR0'
265
+ $map = require $dir.'/autoload_namespaces.php';
266
+ foreach ($map as $namespace => $path) {
267
+ $loader->add($namespace, $path);
268
+ }
269
+
270
+
271
+ PSR0;
272
+
273
+ if ($useClassMap) {
274
+ $file .= <<<'CLASSMAP'
275
+ $classMap = require $dir.'/autoload_classmap.php';
276
+ if ($classMap) {
277
+ $loader->addClassMap($classMap);
278
+ }
279
+
280
+
281
+ CLASSMAP;
282
+ }
283
+
284
+ if ($classMapAuthoritative) {
285
+ $file .= <<<'CLASSMAPAUTHORITATIVE'
286
+ $loader->setClassMapAuthoritative(true);
287
+
288
+ CLASSMAPAUTHORITATIVE;
289
+ }
290
+
291
+ if ($useGlobalIncludePath) {
292
+ $file .= <<<'INCLUDEPATH'
293
+ $loader->setUseIncludePath(true);
294
+
295
+
296
+ INCLUDEPATH;
297
+ }
298
+
299
+ if ($targetDirLoader) {
300
+ $file .= <<<REGISTER_AUTOLOAD
301
+ spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
302
+
303
+
304
+ REGISTER_AUTOLOAD;
305
+
306
+ }
307
+
308
+ $file .= <<<METHOD_FOOTER
309
+ \$loader->register($prependAutoloader);{$filesCode}
310
+
311
+ return \$loader;
312
+ }
313
+
314
+ METHOD_FOOTER;
315
+
316
+ $file .= $targetDirLoader;
317
+
318
+ return $file . <<<FOOTER
319
+ }
320
+
321
+ FOOTER;
322
+
323
+ }
324
+ }
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ *
12
+ * 99% of this is copied as-is from the original Composer source code and is
13
+ * released under MIT license as well. Copyright goes to:
14
+ *
15
+ * - Fabien Potencier <fabien@symfony.com>
16
+ * - Jordi Boggiano <j.boggiano@seld.be>
17
+ */
18
+
19
+ class xrstf_Composer52_ClassLoader {
20
+ private $prefixes = array();
21
+ private $fallbackDirs = array();
22
+ private $useIncludePath = false;
23
+ private $classMap = array();
24
+ private $classMapAuthoratative = false;
25
+ private $allowUnderscore = false;
26
+
27
+ /**
28
+ * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
+ */
30
+ public function setAllowUnderscore($flag) {
31
+ $this->allowUnderscore = (boolean) $flag;
32
+ }
33
+
34
+ /**
35
+ * @return array
36
+ */
37
+ public function getPrefixes() {
38
+ return $this->prefixes;
39
+ }
40
+
41
+ /**
42
+ * Turns off searching the prefix and fallback directories for classes
43
+ * that have not been registered with the class map.
44
+ *
45
+ * @param bool $classMapAuthoratative
46
+ */
47
+ public function setClassMapAuthoritative($classMapAuthoratative) {
48
+ $this->classMapAuthoratative = $classMapAuthoratative;
49
+ }
50
+
51
+ /**
52
+ * Should class lookup fail if not found in the current class map?
53
+ *
54
+ * @return bool
55
+ */
56
+ public function getClassMapAuthoratative() {
57
+ return $this->classMapAuthoratative;
58
+ }
59
+
60
+ /**
61
+ * @return array
62
+ */
63
+ public function getFallbackDirs() {
64
+ return $this->fallbackDirs;
65
+ }
66
+
67
+ /**
68
+ * @return array
69
+ */
70
+ public function getClassMap() {
71
+ return $this->classMap;
72
+ }
73
+
74
+ /**
75
+ * @param array $classMap class to filename map
76
+ */
77
+ public function addClassMap(array $classMap) {
78
+ if ($this->classMap) {
79
+ $this->classMap = array_merge($this->classMap, $classMap);
80
+ }
81
+ else {
82
+ $this->classMap = $classMap;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Registers a set of classes, merging with any others previously set.
88
+ *
89
+ * @param string $prefix the classes prefix
90
+ * @param array|string $paths the location(s) of the classes
91
+ * @param bool $prepend prepend the location(s)
92
+ */
93
+ public function add($prefix, $paths, $prepend = false) {
94
+ if (!$prefix) {
95
+ if ($prepend) {
96
+ $this->fallbackDirs = array_merge(
97
+ (array) $paths,
98
+ $this->fallbackDirs
99
+ );
100
+ }
101
+ else {
102
+ $this->fallbackDirs = array_merge(
103
+ $this->fallbackDirs,
104
+ (array) $paths
105
+ );
106
+ }
107
+
108
+ return;
109
+ }
110
+
111
+ if (!isset($this->prefixes[$prefix])) {
112
+ $this->prefixes[$prefix] = (array) $paths;
113
+ return;
114
+ }
115
+
116
+ if ($prepend) {
117
+ $this->prefixes[$prefix] = array_merge(
118
+ (array) $paths,
119
+ $this->prefixes[$prefix]
120
+ );
121
+ }
122
+ else {
123
+ $this->prefixes[$prefix] = array_merge(
124
+ $this->prefixes[$prefix],
125
+ (array) $paths
126
+ );
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Registers a set of classes, replacing any others previously set.
132
+ *
133
+ * @param string $prefix the classes prefix
134
+ * @param array|string $paths the location(s) of the classes
135
+ */
136
+ public function set($prefix, $paths) {
137
+ if (!$prefix) {
138
+ $this->fallbackDirs = (array) $paths;
139
+ return;
140
+ }
141
+
142
+ $this->prefixes[$prefix] = (array) $paths;
143
+ }
144
+
145
+ /**
146
+ * Turns on searching the include path for class files.
147
+ *
148
+ * @param bool $useIncludePath
149
+ */
150
+ public function setUseIncludePath($useIncludePath) {
151
+ $this->useIncludePath = $useIncludePath;
152
+ }
153
+
154
+ /**
155
+ * Can be used to check if the autoloader uses the include path to check
156
+ * for classes.
157
+ *
158
+ * @return bool
159
+ */
160
+ public function getUseIncludePath() {
161
+ return $this->useIncludePath;
162
+ }
163
+
164
+ /**
165
+ * Registers this instance as an autoloader.
166
+ */
167
+ public function register() {
168
+ spl_autoload_register(array($this, 'loadClass'), true);
169
+ }
170
+
171
+ /**
172
+ * Unregisters this instance as an autoloader.
173
+ */
174
+ public function unregister() {
175
+ spl_autoload_unregister(array($this, 'loadClass'));
176
+ }
177
+
178
+ /**
179
+ * Loads the given class or interface.
180
+ *
181
+ * @param string $class the name of the class
182
+ * @return bool|null true, if loaded
183
+ */
184
+ public function loadClass($class) {
185
+ if ($file = $this->findFile($class)) {
186
+ include $file;
187
+ return true;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Finds the path to the file where the class is defined.
193
+ *
194
+ * @param string $class the name of the class
195
+ * @return string|null the path, if found
196
+ */
197
+ public function findFile($class) {
198
+ if ('\\' === $class[0]) {
199
+ $class = substr($class, 1);
200
+ }
201
+
202
+ if (isset($this->classMap[$class])) {
203
+ return $this->classMap[$class];
204
+ }
205
+ elseif ($this->classMapAuthoratative) {
206
+ return false;
207
+ }
208
+
209
+ $classPath = $this->getClassPath($class);
210
+
211
+ foreach ($this->prefixes as $prefix => $dirs) {
212
+ if (0 === strpos($class, $prefix)) {
213
+ foreach ($dirs as $dir) {
214
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ foreach ($this->fallbackDirs as $dir) {
222
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
224
+ }
225
+ }
226
+
227
+ if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
+ return $file;
229
+ }
230
+
231
+ return $this->classMap[$class] = false;
232
+ }
233
+
234
+ private function getClassPath($class) {
235
+ if (false !== $pos = strrpos($class, '\\')) {
236
+ // namespaced class name
237
+ $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
+ $className = substr($class, $pos + 1);
239
+ }
240
+ else {
241
+ // PEAR-like class name
242
+ $classPath = null;
243
+ $className = $class;
244
+ }
245
+
246
+ $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
+
248
+ // restore the prefix
249
+ if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
+ $className[0] = '_';
251
+ }
252
+
253
+ $classPath .= $className.'.php';
254
+
255
+ return $classPath;
256
+ }
257
+
258
+ public static function resolveIncludePath($classPath) {
259
+ $paths = explode(PATH_SEPARATOR, get_include_path());
260
+
261
+ foreach ($paths as $path) {
262
+ $path = rtrim($path, '/\\');
263
+
264
+ if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
+ return $file;
266
+ }
267
+ }
268
+
269
+ return false;
270
+ }
271
+ }
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ */
10
+
11
+ namespace xrstf\Composer52;
12
+
13
+ use Composer\Repository\CompositeRepository;
14
+ use Composer\Script\Event;
15
+
16
+ class Generator {
17
+ public static function onPostInstallCmd(Event $event) {
18
+ $composer = $event->getComposer();
19
+ $installationManager = $composer->getInstallationManager();
20
+ $repoManager = $composer->getRepositoryManager();
21
+ $localRepo = $repoManager->getLocalRepository();
22
+ $package = $composer->getPackage();
23
+ $config = $composer->getConfig();
24
+
25
+ // We can't gain access to the Command's input object, so we have to look
26
+ // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
27
+ // (always returns an empty array), nor does Symfony's Console Input, as
28
+ // it expects a full definition of the current command line and we can't
29
+ // provide that.
30
+
31
+ // $def = new InputDefinition(array(new InputOption('optimize', 'o', InputOption::VALUE_NONE)));
32
+ // $input = new ArgvInput(null, $def);
33
+ // var_dump($input->hasOption('o')); // "Too many arguments"
34
+
35
+ // $options = getopt('o', array('optimize-autoloader')); // always array()
36
+ // $optimize = !empty($options);
37
+
38
+ $args = $_SERVER['argv'];
39
+ $optimize = in_array('-o', $args) || in_array('-o', $args);
40
+
41
+ $generator = new AutoloadGenerator();
42
+ $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
43
+ }
44
+ }
vendor/yoast/api-libs/README.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ Yoast API libraries
2
+ ==========================
3
+ This repository currently contains client API libraries for the following services:
4
+ * Google Analytics
vendor/yoast/api-libs/class-api-libs.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Include this class to use the Yoast_Api_Libs, you can include this as a submodule in your project
5
+ * and you just have to autoload this class
6
+ *
7
+ *
8
+ * NAMING CONVENTIONS
9
+ * - Register 'oauth' by using $this->register_api_library()
10
+ * - Create folder 'oauth'
11
+ * - Create file 'class-api-oauth.php'
12
+ * - Class name should be 'Yoast_Api_Oauth'
13
+ */
14
+ class Yoast_Api_Libs {
15
+
16
+ /**
17
+ * Store the available API libraries
18
+ *
19
+ * @var array
20
+ */
21
+ private static $api_libs = array();
22
+
23
+ /**
24
+ * Store the instances of the API class
25
+ *
26
+ * @var array
27
+ */
28
+ private static $instances = array();
29
+
30
+ /**
31
+ * Call this method to init the libraries you need
32
+ *
33
+ * @param array $libraries
34
+ *
35
+ * @return bool True when at least 1 library is registered, False when there was 1 failure or when there is no class loaded at all
36
+ */
37
+ public static function load_api_libraries( $libraries = array() ) {
38
+ $succeeded = 0;
39
+ $failed = 0;
40
+
41
+ if ( is_array( $libraries ) && count( $libraries ) >= 1 ) {
42
+ foreach ( $libraries as $lib ) {
43
+ if ( self::register_api_library( $lib ) ) {
44
+ $succeeded ++;
45
+ } else {
46
+ $failed ++;
47
+ }
48
+ }
49
+ }
50
+
51
+ if ( $succeeded >= 1 && $failed == 0 ) {
52
+ return true;
53
+ } else {
54
+ return false;
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Get the registered API libraries
60
+ *
61
+ * @return array
62
+ */
63
+ public static function get_api_libs() {
64
+ return self::$api_libs;
65
+ }
66
+
67
+ /**
68
+ * Register a new API library to this class
69
+ *
70
+ * @param $name
71
+ *
72
+ * @return bool
73
+ */
74
+ private static function register_api_library( $name ) {
75
+ $name = strtolower( $name );
76
+ $classname = 'Yoast_Api_' . ucfirst( $name );
77
+ $classpath = 'class-api-' . $name . '.php';
78
+ $path_to_require = dirname( __FILE__ ) . '/' . $name . '/' . $classpath;
79
+
80
+ // Check if the API Libs was already registered
81
+ if ( isset( self::$api_libs[$name] ) ) {
82
+ return true;
83
+ }
84
+
85
+ self::$api_libs[$name] = array(
86
+ 'name' => $name,
87
+ 'classname' => $classname,
88
+ 'classpath' => $classpath,
89
+ 'path_to_require' => $path_to_require,
90
+ );
91
+
92
+ if ( file_exists( $path_to_require ) ) {
93
+ include( $path_to_require );
94
+
95
+ if ( class_exists( $classname ) ) {
96
+ $instance = new $classname;
97
+
98
+ self::$instances[$name] = $instance;
99
+
100
+ return true;
101
+ }
102
+ }
103
+
104
+ return false;
105
+ }
106
+
107
+ /**
108
+ * Get instance
109
+ *
110
+ * @param $name
111
+ *
112
+ * @return bool
113
+ */
114
+ public function get_instance( $name ) {
115
+ if ( isset( self::$instances[$name] ) ) {
116
+ return self::$instances[$name];
117
+ }
118
+
119
+ return false;
120
+ }
121
+
122
+ /**
123
+ * Execute a call with this method
124
+ *
125
+ * @param $instance
126
+ * @param $method
127
+ * @param array $params
128
+ */
129
+ public static function do_call( $instance, $method, $params = array() ) {
130
+ $class = self::$instances[$instance];
131
+
132
+ $class->$method( $params );
133
+ // Call user func?
134
+ }
135
+
136
+ }
{admin → vendor/yoast}/api-libs/composer.json RENAMED
@@ -3,7 +3,7 @@
3
  "description": "Shared API libraries for Yoast projects.",
4
  "keywords" : ["wordpress"],
5
  "homepage" : "https://github.com/Yoast/api-libs",
6
- "license" : "GPL-2.0+",
7
  "authors" : [
8
  {
9
  "name" : "Team Yoast",
3
  "description": "Shared API libraries for Yoast projects.",
4
  "keywords" : ["wordpress"],
5
  "homepage" : "https://github.com/Yoast/api-libs",
6
+ "license" : "GPL-3.0",
7
  "authors" : [
8
  {
9
  "name" : "Team Yoast",
{admin → vendor/yoast}/api-libs/google/Google_Client.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_AssertionCredentials.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_Auth.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_AuthNone.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_LoginTicket.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_OAuth2.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_P12Signer.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_PemVerifier.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_Signer.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/auth/Google_Verifier.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/cache/Google_ApcCache.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/cache/Google_Cache.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/cache/Google_FileCache.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/cache/Google_MemcacheCache.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/cache/Google_WPCache.php RENAMED
File without changes
vendor/yoast/api-libs/google/class-api-google.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoast_Api_Google {
4
+
5
+ public $options;
6
+
7
+ /**
8
+ * This class will be loaded when someone calls the API library with the Google analytics module
9
+ */
10
+ public function __construct() {
11
+ $this->load_api_google_files();
12
+ }
13
+
14
+ /**
15
+ * Register the Autoload the Google class
16
+ */
17
+ private function load_api_google_files() {
18
+ spl_autoload_register( array( $this, 'autoload_api_google_files' ) );
19
+ }
20
+
21
+ /**
22
+ * Autoload the API Google class
23
+ *
24
+ * @param string $class_name - The class that should be loaded
25
+ */
26
+ private function autoload_api_google_files( $class_name ) {
27
+ $path = dirname( __FILE__ );
28
+ $class_name = strtolower( $class_name );
29
+ $oauth_files = array(
30
+ // Main requires
31
+ 'yoast_google_client' => 'Google_Client',
32
+
33
+ // Requires in classes
34
+ 'yoast_google_model' => 'service/Google_Model',
35
+ 'yoast_google_service' => 'service/Google_Service',
36
+ 'yoast_google_serviceresource' => 'service/Google_ServiceResource',
37
+ 'yoast_google_assertion' => 'auth/Google_AssertionCredentials',
38
+ 'yoast_google_signer' => 'auth/Google_Signer',
39
+ 'yoast_google_p12signer' => 'auth/Google_P12Signer',
40
+ 'yoast_google_batchrequest' => 'service/Google_BatchRequest',
41
+ 'yoast_google_uritemplate' => 'external/URITemplateParser',
42
+ 'yoast_google_auth' => 'auth/Google_Auth',
43
+ 'yoast_google_cache' => 'cache/Google_Cache',
44
+ 'yoast_google_io' => 'io/Google_IO',
45
+ 'yoast_google_mediafileupload' => 'service/Google_MediaFileUpload',
46
+ 'yoast_google_authnone' => 'auth/Google_AuthNone',
47
+ 'yoast_google_oauth2' => 'auth/Google_OAuth2',
48
+ 'yoast_google_verifier' => 'auth/Google_Verifier',
49
+ 'yoast_google_loginticket' => 'auth/Google_LoginTicket',
50
+ 'yoast_google_utils' => 'service/Google_Utils',
51
+ 'yoast_google_pemverifier' => 'auth/Google_PemVerifier',
52
+
53
+ // Caching
54
+ 'yoast_google_filecache' => 'cache/Google_FileCache',
55
+ 'yoast_google_memcachecache' => 'cache/Google_MemcacheCache',
56
+ 'yoast_google_cacheparser' => 'io/Google_CacheParser',
57
+
58
+ // Requests
59
+ 'yoast_google_httprequest' => 'io/Google_HttpRequest',
60
+ 'yoast_google_httpstream_io' => 'io/Google_HttpStreamIO',
61
+ 'yoast_google_rest' => 'io/Google_REST',
62
+
63
+ // Wordpress
64
+ 'yoast_google_wpio' => 'io/Google_WPIO',
65
+ 'yoast_google_wpcache' => 'cache/Google_WPCache',
66
+
67
+ // REPLACE ME!
68
+ 'yoast_google_curlio' => 'io/Google_CurlIO',
69
+ );
70
+
71
+ if ( ! empty( $oauth_files[$class_name] ) ) {
72
+ if ( file_exists( $path . '/' . $oauth_files[$class_name] . '.php' ) ) {
73
+ require_once( $path . '/' . $oauth_files[$class_name] . '.php' );
74
+ }
75
+
76
+ }
77
+
78
+ }
79
+
80
+ }
{admin → vendor/yoast}/api-libs/google/config.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/external/URITemplateParser.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_CacheParser.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_CurlIO.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_HttpRequest.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_HttpStreamIO.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_IO.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_REST.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/Google_WPIO.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/io/cacerts.pem RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/service/Google_BatchRequest.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/service/Google_MediaFileUpload.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/service/Google_Model.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/service/Google_Service.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/service/Google_ServiceResource.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/google/service/Google_Utils.php RENAMED
File without changes
vendor/yoast/api-libs/googleanalytics/class-api-googleanalytics.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yoast_Api_Googleanalytics {
4
+
5
+ /**
6
+ * This class will be loaded when someone calls the API library with the Google analytics module
7
+ */
8
+ public function __construct() {
9
+ $this->load_api_oauth_files();
10
+ }
11
+
12
+ /**
13
+ * Register the Autoload the Oauth classes
14
+ */
15
+ private function load_api_oauth_files() {
16
+ spl_autoload_register( array( $this, 'autoload_api_oauth_files' ) );
17
+ }
18
+
19
+ /**
20
+ * Autoload the API Oauth classes
21
+ *
22
+ * @param string $class_name - The class that should be loaded
23
+ */
24
+ private function autoload_api_oauth_files( $class_name ) {
25
+ $path = dirname( __FILE__ );
26
+ $class_name = strtolower( $class_name );
27
+ $oauth_files = array(
28
+ 'yoast_googleanalytics_reporting' => 'class-googleanalytics-reporting',
29
+ 'yoast_google_analytics_client' => 'class-google-analytics-client',
30
+ );
31
+
32
+ if ( ! empty( $oauth_files[$class_name] ) ) {
33
+ if ( file_exists( $path . '/' . $oauth_files[$class_name] . '.php' ) ) {
34
+ require_once( $path . '/' . $oauth_files[$class_name] . '.php' );
35
+ }
36
+
37
+ }
38
+
39
+ }
40
+
41
+ }
{admin → vendor/yoast}/api-libs/googleanalytics/class-google-analytics-client.php RENAMED
@@ -179,4 +179,4 @@ class Yoast_Google_Analytics_Client extends Yoast_Google_Client {
179
  return get_option( self::OPTION_REFRESH_TOKEN, '' );
180
  }
181
 
182
- }
179
  return get_option( self::OPTION_REFRESH_TOKEN, '' );
180
  }
181
 
182
+ }
{admin → vendor/yoast}/api-libs/googleanalytics/class-googleanalytics-reporting.php RENAMED
@@ -148,4 +148,4 @@ class Yoast_Googleanalytics_Reporting {
148
  return $dates;
149
  }
150
 
151
- }
148
  return $dates;
149
  }
150
 
151
+ }
{admin → vendor/yoast}/api-libs/tests/google/text-class-api-google.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/tests/googleanalytics/test-class-api-googleanalytics.php RENAMED
File without changes
{admin → vendor/yoast}/api-libs/tests/test-class-api-libs.php RENAMED
File without changes
{admin → vendor/yoast}/i18n-module/LICENSE RENAMED
File without changes
{admin → vendor/yoast}/i18n-module/README.md RENAMED
File without changes
vendor/yoast/i18n-module/composer.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name" : "yoast/i18n-module",
3
+ "description": "Handle i18n for WordPress plugins.",
4
+ "keywords" : ["wordpress"],
5
+ "homepage" : "https://github.com/Yoast/i18n-module",
6
+ "license" : "GPL-2.0+",
7
+ "authors" : [
8
+ {
9
+ "name" : "Team Yoast",
10
+ "email" : "support@yoast.com",
11
+ "homepage": "https://yoast.com"
12
+ }
13
+ ],
14
+ "support" : {
15
+ "issues": "https://github.com/Yoast/i18n-module/issues"
16
+ },
17
+ "autoload" : {
18
+ "classmap": ["i18n-module.php"]
19
+ }
20
+ }
{admin → vendor/yoast}/i18n-module/i18n-module.php RENAMED
@@ -166,11 +166,11 @@ class yoast_i18n {
166
  private function promo_message() {
167
  $message = false;
168
 
169
- if ( $this->translation_loaded && $this->percent_translated < 90 ) {
170
  $message = __( 'As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help complete the translation to %1$s!', $this->textdomain );
171
  } else if ( ! $this->translation_loaded && $this->translation_exists ) {
172
  $message = __( 'You\'re using WordPress in %1$s. While %2$s has been translated to %1$s for %3$d%%, it\'s not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', $this->textdomain );
173
- } else if ( ! $this->translation_loaded && ! $this->translation_exists ) {
174
  $message = __( 'You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', $this->textdomain );
175
  }
176
 
@@ -267,7 +267,7 @@ class yoast_i18n {
267
  * @access private
268
  */
269
  private function parse_translation_set( $set ) {
270
- if ( $this->translation_exists ) {
271
  $this->locale_name = $set->name;
272
  $this->percent_translated = $set->percent_translated;
273
  } else {
166
  private function promo_message() {
167
  $message = false;
168
 
169
+ if ( $this->translation_exists && $this->translation_loaded && $this->percent_translated < 90 ) {
170
  $message = __( 'As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help complete the translation to %1$s!', $this->textdomain );
171
  } else if ( ! $this->translation_loaded && $this->translation_exists ) {
172
  $message = __( 'You\'re using WordPress in %1$s. While %2$s has been translated to %1$s for %3$d%%, it\'s not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', $this->textdomain );
173
+ } else if ( ! $this->translation_exists ) {
174
  $message = __( 'You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', $this->textdomain );
175
  }
176
 
267
  * @access private
268
  */
269
  private function parse_translation_set( $set ) {
270
+ if ( $this->translation_exists && is_object( $set ) ) {
271
  $this->locale_name = $set->name;
272
  $this->percent_translated = $set->percent_translated;
273
  } else {
{admin → vendor/yoast}/license-manager/README.md RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-api-request.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-license-manager.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-plugin-license-manager.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-plugin-update-manager.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-product.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-theme-license-manager.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-theme-update-manager.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/class-update-manager.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/composer.json RENAMED
File without changes
{admin → vendor/yoast}/license-manager/index.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/samples/index.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/samples/sample-plugin.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/samples/sample-product.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/samples/sample-theme-functions.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/views/form.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/views/index.php RENAMED
File without changes
{admin → vendor/yoast}/license-manager/views/script.php RENAMED
File without changes