Classic Editor Addon - Version 2.0.0

Version Description

  • July 16, 2018
  • add WP Dependency Installer to facilitate with installing and activating Classic Editor plugin (changed color of admin notice to blue)
  • adjust minimum PHP version (to 5.3) due to addition of WP Dependency Installer
Download this release

Release Info

Developer senlin
Plugin Icon wp plugin Classic Editor Addon
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.4.0 to 2.0.0

Files changed (142) hide show
  1. LICENSE +674 -0
  2. classic-editor-addon.php +10 -7
  3. readme.txt +17 -3
  4. vendor/afragen/wp-dependency-installer/LICENSE +21 -0
  5. vendor/afragen/wp-dependency-installer/README.md +91 -0
  6. vendor/afragen/wp-dependency-installer/composer.json +31 -0
  7. vendor/afragen/wp-dependency-installer/example-plugin/test-dependency-installer.php +16 -0
  8. vendor/afragen/wp-dependency-installer/wp-dependencies-example.json +36 -0
  9. vendor/afragen/wp-dependency-installer/wp-dependency-installer.php +456 -0
  10. vendor/autoload.php +7 -0
  11. vendor/collizo4sky/persist-admin-notices-dismissal/README.md +108 -0
  12. vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js +29 -0
  13. vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php +119 -0
  14. vendor/composer/ClassLoader.php +445 -0
  15. vendor/composer/LICENSE +21 -0
  16. vendor/composer/autoload_classmap.php +9 -0
  17. vendor/composer/autoload_files.php +11 -0
  18. vendor/composer/autoload_namespaces.php +9 -0
  19. vendor/composer/autoload_psr4.php +10 -0
  20. vendor/composer/autoload_real.php +70 -0
  21. vendor/composer/autoload_static.php +36 -0
  22. vendor/composer/installed.json +202 -0
  23. vendor/composer/installers/.editorconfig +10 -0
  24. vendor/composer/installers/.gitignore +3 -0
  25. vendor/composer/installers/.travis.yml +33 -0
  26. vendor/composer/installers/CHANGELOG.md +86 -0
  27. vendor/composer/installers/CONTRIBUTING.md +24 -0
  28. vendor/composer/installers/LICENSE +19 -0
  29. vendor/composer/installers/README.md +221 -0
  30. vendor/composer/installers/_config.yml +1 -0
  31. vendor/composer/installers/composer.json +105 -0
  32. vendor/composer/installers/phpunit.xml.dist +25 -0
  33. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +21 -0
  34. vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +9 -0
  35. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +11 -0
  36. vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +49 -0
  37. vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +9 -0
  38. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +136 -0
  39. vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +126 -0
  40. vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +9 -0
  41. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +82 -0
  42. vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +11 -0
  43. vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +10 -0
  44. vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +34 -0
  45. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +11 -0
  46. vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +13 -0
  47. vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +35 -0
  48. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +21 -0
  49. vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +10 -0
  50. vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +50 -0
  51. vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +16 -0
  52. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +16 -0
  53. vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +9 -0
  54. vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +12 -0
  55. vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +29 -0
  56. vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +10 -0
  57. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +11 -0
  58. vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +9 -0
  59. vendor/composer/installers/src/Composer/Installers/GravInstaller.php +30 -0
  60. vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +25 -0
  61. vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +11 -0
  62. vendor/composer/installers/src/Composer/Installers/Installer.php +200 -0
  63. vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +9 -0
  64. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +15 -0
  65. vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +18 -0
  66. vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +11 -0
  67. vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +10 -0
  68. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +9 -0
  69. vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +27 -0
  70. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +9 -0
  71. vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +10 -0
  72. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +10 -0
  73. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +9 -0
  74. vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +16 -0
  75. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +11 -0
  76. vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +37 -0
  77. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +9 -0
  78. vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +25 -0
  79. vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +33 -0
  80. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +50 -0
  81. vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +111 -0
  82. vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +12 -0
  83. vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +57 -0
  84. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +46 -0
  85. vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +24 -0
  86. vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +14 -0
  87. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +59 -0
  88. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +9 -0
  89. vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +11 -0
  90. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +11 -0
  91. vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +21 -0
  92. vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +32 -0
  93. vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +29 -0
  94. vendor/composer/installers/src/Composer/Installers/Plugin.php +17 -0
  95. vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +9 -0
  96. vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +10 -0
  97. vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +11 -0
  98. vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +63 -0
  99. vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +24 -0
  100. vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +10 -0
  101. vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +10 -0
  102. vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +22 -0
  103. vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +10 -0
  104. vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +60 -0
  105. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +35 -0
  106. vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +25 -0
  107. vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +49 -0
  108. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +26 -0
  109. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +16 -0
  110. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +38 -0
  111. vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +12 -0
  112. vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +14 -0
  113. vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +9 -0
  114. vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +10 -0
  115. vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +49 -0
  116. vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +10 -0
  117. vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +9 -0
  118. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +12 -0
  119. vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +32 -0
  120. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +11 -0
  121. vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +10 -0
  122. vendor/composer/installers/src/bootstrap.php +13 -0
  123. vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php +80 -0
  124. vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php +75 -0
  125. vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +114 -0
  126. vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php +83 -0
  127. vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php +90 -0
  128. vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php +63 -0
  129. vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +552 -0
  130. vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php +62 -0
  131. vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php +67 -0
  132. vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php +67 -0
  133. vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php +84 -0
  134. vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php +44 -0
  135. vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php +63 -0
  136. vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php +120 -0
  137. vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php +82 -0
  138. vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php +65 -0
  139. vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php +80 -0
  140. vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php +64 -0
  141. vendor/composer/installers/tests/bootstrap.php +4 -0
  142. wp-dependencies.json +9 -0
LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
classic-editor-addon.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: This free "Classic Editor Addon" plugin changes the default behaviour of the "Classic Editor" plugin; and then some. See readme.txt for more details.
5
 
6
  * Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a>
7
- * Version: 1.4.0
8
 
9
  * Requires at least: 4.9
10
  * Tested up to: 4.9.7
@@ -25,8 +25,12 @@
25
  // don't load the plugin file directly
26
  if ( ! defined( 'ABSPATH' ) ) exit;
27
 
28
- add_action( 'plugins_loaded', 'classic_editor_addon_pre_init', 1, 0 );
 
 
29
 
 
 
30
  function classic_editor_addon_pre_init() {
31
 
32
  if ( function_exists( 'classic_editor_init_actions' ) ) {
@@ -40,8 +44,11 @@ function classic_editor_addon_pre_init() {
40
 
41
  }
42
 
43
- add_action( 'plugins_loaded', 'classic_editor_addon_post_init', 20, 0 );
 
 
44
 
 
45
  function classic_editor_addon_post_init() {
46
 
47
  /**
@@ -63,7 +70,3 @@ function classic_editor_addon_post_init() {
63
  }
64
 
65
  }
66
-
67
- function classic_editor_addon_hardcode_replace( $value ) {
68
- return 'replace';
69
- }
4
  * Description: This free "Classic Editor Addon" plugin changes the default behaviour of the "Classic Editor" plugin; and then some. See readme.txt for more details.
5
 
6
  * Author: <a href="https://so-wp.com">Pieter Bos</a>, <a href="https://gschoppe.com">Greg Schoppe</a>
7
+ * Version: 2.0.0
8
 
9
  * Requires at least: 4.9
10
  * Tested up to: 4.9.7
25
  // don't load the plugin file directly
26
  if ( ! defined( 'ABSPATH' ) ) exit;
27
 
28
+ // Load WP_Dependency_Installer
29
+ include_once( __DIR__ . '/vendor/autoload.php' );
30
+ WP_Dependency_Installer::instance()->run( __DIR__ );
31
 
32
+ // Hardcode the replace option into Classic Editor, bypassng their settings
33
+ add_action( 'plugins_loaded', 'classic_editor_addon_pre_init', 1, 0 );
34
  function classic_editor_addon_pre_init() {
35
 
36
  if ( function_exists( 'classic_editor_init_actions' ) ) {
44
 
45
  }
46
 
47
+ function classic_editor_addon_hardcode_replace( $value ) {
48
+ return 'replace';
49
+ }
50
 
51
+ add_action( 'plugins_loaded', 'classic_editor_addon_post_init', 20, 0 );
52
  function classic_editor_addon_post_init() {
53
 
54
  /**
70
  }
71
 
72
  }
 
 
 
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: senlin, gschoppe
3
  Tags: gutenberg, classic editor, addon
4
  Requires at least: 4.9
5
- Requires PHP: 5.2
6
  Tested up to: 4.9.7
7
- Stable tag: 1.4.0
8
  License: GPL-3.0+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
10
 
@@ -18,6 +18,8 @@ The "Classic Editor" plugin doesn't remove Gutenberg by default. With this free
18
 
19
  In addition to this most basic requirement, the "Classic Editor Addon" removes the Settings link from the main Plugins page and removes the plugin's Settings from the Settings > Writing screen. Also the drop down buttons Gutenberg adds to the post type screens is replaced with the regular "Add New" button.
20
 
 
 
21
  Last but not least the Classic Editor Addon suppresses the Nag screen that is slated to arrive in the Dashboard with WP version 4.9.8.
22
 
23
  The free Classic Editor Addon plugin is targeted at everyone who is not yet ready for Gutenberg and/or who does not want to bother clients with Gutenberg. Install it now on sites and by the time WP 4.9.8 and eventually 5.0 are released, the UX remains the same as you are used to!
@@ -42,7 +44,7 @@ The "Classic Editor" plugin, by Andrew Ozz, doesn't completely disable Gutenberg
42
 
43
  = How does this compare to other plugins that disable Gutenberg? =
44
 
45
- Great question! Classic editor is the official plugin for removing Gutenberg, and the install count is apparently being used as a metric to gauge success of the Gutenberg project. So, although other plugins exist to force-disable Gutenberg, using them doesn't properly notify the WP Core team of the number of issues users are having, that is why "Classic Editor Addon" doesn't disable Gutenberg itself, it just properly sets the options for "Classic Editor" and disables the Gutenberg Nag notice, making it easier to mass-install classic editor.
46
 
47
  = The plugin doesn't do anything! =
48
 
@@ -54,6 +56,12 @@ Please open an issue on [Github](https://github.com/senlin/classic-editor-addon/
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
57
  = 1.4.0 =
58
 
59
  * July 12, 2018
@@ -79,3 +87,9 @@ Please open an issue on [Github](https://github.com/senlin/classic-editor-addon/
79
 
80
  * February 3, 2018
81
  * Released as [code snippet](https://gist.github.com/senlin/691c5f06459857f57247dc92f7ec1406/6f4091caf458fbec70b33df5d136d66e8e3b6b29)
 
 
 
 
 
 
2
  Contributors: senlin, gschoppe
3
  Tags: gutenberg, classic editor, addon
4
  Requires at least: 4.9
5
+ Requires PHP: 5.3
6
  Tested up to: 4.9.7
7
+ Stable tag: 2.0.0
8
  License: GPL-3.0+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
10
 
18
 
19
  In addition to this most basic requirement, the "Classic Editor Addon" removes the Settings link from the main Plugins page and removes the plugin's Settings from the Settings > Writing screen. Also the drop down buttons Gutenberg adds to the post type screens is replaced with the regular "Add New" button.
20
 
21
+ **Update:** With version 2.0.0 we have added a class that detects whether the main "Classic Editor" plugin already has been installed and activated. If it hasn't, that plugin can be installed with one click. The notice can also be dismissed.
22
+
23
  Last but not least the Classic Editor Addon suppresses the Nag screen that is slated to arrive in the Dashboard with WP version 4.9.8.
24
 
25
  The free Classic Editor Addon plugin is targeted at everyone who is not yet ready for Gutenberg and/or who does not want to bother clients with Gutenberg. Install it now on sites and by the time WP 4.9.8 and eventually 5.0 are released, the UX remains the same as you are used to!
44
 
45
  = How does this compare to other plugins that disable Gutenberg? =
46
 
47
+ Great question! "Classic Editor" is the official plugin for removing Gutenberg, and the install count is apparently being used as a metric to gauge success of the Gutenberg project. So, although other plugins exist to force-disable Gutenberg, using them doesn't properly notify the WP Core team of the number of issues users are having, that is why "Classic Editor Addon" doesn't disable Gutenberg itself, it just properly sets the options for "Classic Editor" and disables the Gutenberg Nag notice, making it easier to mass-install classic editor.
48
 
49
  = The plugin doesn't do anything! =
50
 
56
 
57
  == Changelog ==
58
 
59
+ = 2.0.0 =
60
+
61
+ * July 16, 2018
62
+ * add WP Dependency Installer to facilitate with installing and activating Classic Editor plugin (changed color of admin notice to blue)
63
+ * adjust minimum PHP version (to 5.3) due to addition of WP Dependency Installer
64
+
65
  = 1.4.0 =
66
 
67
  * July 12, 2018
87
 
88
  * February 3, 2018
89
  * Released as [code snippet](https://gist.github.com/senlin/691c5f06459857f57247dc92f7ec1406/6f4091caf458fbec70b33df5d136d66e8e3b6b29)
90
+
91
+ == Upgrade Notice ==
92
+
93
+ = 2.0.0 =
94
+
95
+ * now the plugin requires PHP 5.3 due to addition of WP Dependency Installer
vendor/afragen/wp-dependency-installer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Andy Fragen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vendor/afragen/wp-dependency-installer/README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WP Dependency Installer
2
+ * Contributors: [Andy Fragen](https://github.com/afragen), [Matt Gibbs](https://github.com/mgibbs189), [contributors](https://github.com/afragen/wp-dependency-installer/graphs/contributors)
3
+ * Tags: plugin, dependency, install
4
+ * Requires at least: 3.8
5
+ * Requires PHP: 5.3
6
+ * Tested up to: 4.8
7
+ * Stable tag: master
8
+ * Donate link: http://thefragens.com/wp-dependency-installer-donate
9
+ * License: MIT
10
+
11
+ A lightweight class to add to WordPress plugins or themes to automatically install required plugin dependencies. Uses a JSON config file to declare plugin dependencies.
12
+
13
+ ## Description
14
+
15
+ This is a drop in class for developers to optionally or automatically install plugin dependencies for their own plugins or themes. It can install a plugin from w.org, GitHub, Bitbucket, or GitLab. You must include a JSON config file in the same directory as this class file.
16
+
17
+ This contains an example plugin and an example JSON configuration file. Only required dependencies are installed automatically, optional dependencies are not. Required dependencies are always kept active.
18
+
19
+ ## Installation
20
+
21
+ Install the package via composer.
22
+
23
+ Run the composer command: ```composer require afragen/wp-dependency-installer```
24
+
25
+ Then create a new `wp-dependencies.json` file.
26
+
27
+ ```cp ./vendor/afragen/wp-dependency-installer/wp-dependencies-example.json wp-dependencies.json```
28
+
29
+ You will then need to update `wp-dependencies.json` to suit your requirements.
30
+
31
+ Add the following lines to your plugin or to your theme's `functions.php` file.
32
+
33
+ ```php
34
+ include_once( __DIR__ . '/vendor/autoload.php' );
35
+ WP_Dependency_Installer::instance()->run( __DIR__ );
36
+ ```
37
+
38
+ ## JSON config file format
39
+
40
+ This file must be named `wp-dependencies.json` and it must be in the root directory of your plugin or theme.
41
+
42
+ ```json
43
+ [
44
+ {
45
+ "name": "Query Monitor",
46
+ "host": "wordpress",
47
+ "slug": "query-monitor/query-monitor.php",
48
+ "uri": "https://wordpress.org/plugins/query-monitor/",
49
+ "branch": "trunk",
50
+ "optional": false
51
+ },
52
+ {
53
+ "name": "GitHub Updater",
54
+ "host": "github",
55
+ "slug": "github-updater/github-updater.php",
56
+ "uri": "afragen/github-updater",
57
+ "branch": "master",
58
+ "optional": false,
59
+ "token": null
60
+ },
61
+ {
62
+ "name": "Test Plugin Notags",
63
+ "slug": "test-plugin-notags/test-plugin-notags.php",
64
+ "uri": "https://bitbucket.org/afragen/test-plugin-notags",
65
+ "branch": "master",
66
+ "optional": true,
67
+ "token": null
68
+ },
69
+ {
70
+ "name": "Test Gitlab Plugin2",
71
+ "host": "gitlab",
72
+ "slug": "test-gitlab-plugin2/test-gitlab-plugin2.php",
73
+ "uri": "https://gitlab.com/afragen/test-gitlab-plugin2",
74
+ "branch": "develop",
75
+ "optional": true,
76
+ "token": null
77
+ }
78
+ ]
79
+ ```
80
+
81
+ An example file is included, `wp-dependencies-example.json`. You may use a shorthand uri such as `<owner>/<repo>` but only if you include the `host` element in the JSON. If you have a full URI in the `uri` element then the `host` element is optional.
82
+
83
+ If you want to programmatically add dependencies you can send an associative array directly to
84
+ ```php
85
+ WP_Dependency_Installer::instance()->register( $config )
86
+ ```
87
+ where `$config` is an associative array as in identical format as `json_decode( wp-dependencies.json content )`
88
+
89
+ ## Development
90
+
91
+ PRs are welcome against the `develop` branch.
vendor/afragen/wp-dependency-installer/composer.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "afragen/wp-dependency-installer",
3
+ "description": "Library that helps WordPress plugin dependency management.",
4
+ "license": "MIT",
5
+ "authors": [
6
+ {
7
+ "name": "Andy Fragen",
8
+ "email": "andy@thefragens.com",
9
+ "homepage": "https://thefragens.com",
10
+ "role": "Developer"
11
+ },
12
+ {
13
+ "name": "Matt Gibbs",
14
+ "role": "Developer"
15
+ }
16
+ ],
17
+ "prefer-stable": true,
18
+ "require": {
19
+ "composer/installers": "^1.0",
20
+ "php": ">=5.3",
21
+ "collizo4sky/persist-admin-notices-dismissal": ">=1.3"
22
+ },
23
+ "support": {
24
+ "issues": "https://github.com/afragen/wp-dependency-installer/issues"
25
+ },
26
+ "autoload": {
27
+ "files": [
28
+ "wp-dependency-installer.php"
29
+ ]
30
+ }
31
+ }
vendor/afragen/wp-dependency-installer/example-plugin/test-dependency-installer.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Plugin Name: Test Dependency Installer
5
+ * Plugin URI: https://github.com/afragen/wp-dependency-installer
6
+ * Description: This plugin is used for test dependency installation of remote sourced plugins.
7
+ * Version: 1.0
8
+ * Author: Andy Fragen, Matt Gibbs
9
+ * License: MIT
10
+ * Requires WP: 4.0
11
+ * Requires PHP: 5.3
12
+ */
13
+
14
+ require_once __DIR__ . '/vendor/autoload.php';
15
+
16
+ WP_Dependency_Installer::instance()->run( __DIR__ );
vendor/afragen/wp-dependency-installer/wp-dependencies-example.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "Query Monitor",
4
+ "host": "wordpress",
5
+ "slug": "query-monitor/query-monitor.php",
6
+ "uri": "https://wordpress.org/plugins/query-monitor/",
7
+ "branch": "trunk",
8
+ "optional": false
9
+ },
10
+ {
11
+ "name": "GitHub Updater",
12
+ "host": "github",
13
+ "slug": "github-updater/github-updater.php",
14
+ "uri": "afragen/github-updater",
15
+ "branch": "master",
16
+ "optional": false,
17
+ "token": null
18
+ },
19
+ {
20
+ "name": "Test Plugin Notags",
21
+ "slug": "test-plugin-notags/test-plugin-notags.php",
22
+ "uri": "https://bitbucket.org/afragen/test-plugin-notags",
23
+ "branch": "master",
24
+ "optional": true,
25
+ "token": null
26
+ },
27
+ {
28
+ "name": "Test Gitlab Plugin2",
29
+ "host": "gitlab",
30
+ "slug": "test-gitlab-plugin2/test-gitlab-plugin2.php",
31
+ "uri": "https://gitlab.com/afragen/test-gitlab-plugin2",
32
+ "branch": "develop",
33
+ "optional": true,
34
+ "token": null
35
+ }
36
+ ]
vendor/afragen/wp-dependency-installer/wp-dependency-installer.php ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Dependency Installer
5
+ *
6
+ * A lightweight class to add to WordPress plugins or themes to automatically install
7
+ * required plugin dependencies. Uses a JSON config file to declare plugin dependencies.
8
+ * It can install a plugin from w.org, GitHub, Bitbucket, or GitLab.
9
+ *
10
+ * @package WP_Dependency_Installer
11
+ * @author Andy Fragen
12
+ * @author Matt Gibbs
13
+ * @license MIT
14
+ * @link https://github.com/afragen/wp-dependency-installer
15
+ * @version 1.3.3
16
+ */
17
+
18
+ /**
19
+ * Exit if called directly.
20
+ */
21
+ if ( ! defined( 'WPINC' ) ) {
22
+ die;
23
+ }
24
+
25
+ if ( ! class_exists( 'WP_Dependency_Installer' ) ) {
26
+
27
+ /**
28
+ * Class WP_Dependency_Installer
29
+ */
30
+ class WP_Dependency_Installer {
31
+
32
+ /**
33
+ * Holds the singleton instance.
34
+ *
35
+ * @var \WP_Dependency_Installer
36
+ */
37
+ private static $instance;
38
+
39
+ /**
40
+ * Holds the JSON file contents.
41
+ *
42
+ * @var array $config
43
+ */
44
+ protected $config = array();
45
+
46
+ /**
47
+ * Holds the current dependency's slug.
48
+ *
49
+ * @var string $current_slug
50
+ */
51
+ protected $current_slug;
52
+
53
+ /**
54
+ * Holds names of installed dependencies for admin notices.
55
+ *
56
+ * @var array $notices
57
+ */
58
+ protected $notices = array();
59
+
60
+ /**
61
+ * Singleton.
62
+ */
63
+ public static function instance() {
64
+ if ( null === self::$instance ) {
65
+ self::$instance = new self();
66
+ }
67
+
68
+ return self::$instance;
69
+ }
70
+
71
+ /**
72
+ * Load hooks.
73
+ *
74
+ * @return void
75
+ */
76
+ public function load_hooks() {
77
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
78
+ add_action( 'admin_footer', array( $this, 'admin_footer' ) );
79
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
80
+ add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
81
+ add_action( 'wp_ajax_dependency_installer', array( $this, 'ajax_router' ) );
82
+ }
83
+
84
+ /**
85
+ * Register wp-dependencies.json
86
+ *
87
+ * @param string $plugin_path Path to plugin or theme calling the framework.
88
+ */
89
+ public function run( $plugin_path ) {
90
+ if ( file_exists( $plugin_path . '/wp-dependencies.json' ) ) {
91
+ $config = file_get_contents( $plugin_path . '/wp-dependencies.json' );
92
+ if ( empty( $config ) ||
93
+ null === ( $config = json_decode( $config, true ) )
94
+ ) {
95
+ return;
96
+ }
97
+ $this->load_hooks();
98
+ $this->register( $config );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Register dependencies (supports multiple instances).
104
+ *
105
+ * @param array $config JSON config as string.
106
+ */
107
+ public function register( $config ) {
108
+ foreach ( $config as $dependency ) {
109
+ $slug = $dependency['slug'];
110
+ if ( ! isset( $this->config[ $slug ] ) || ! $dependency['optional'] ) {
111
+ $this->config[ $slug ] = $dependency;
112
+ }
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Process the registered dependencies.
118
+ */
119
+ public function apply_config() {
120
+ foreach ( $this->config as $dependency ) {
121
+ $download_link = null;
122
+ $uri = $dependency['uri'];
123
+ $slug = $dependency['slug'];
124
+ $host = explode( '.', parse_url( $uri, PHP_URL_HOST ) );
125
+ $host = isset( $dependency['host'] ) ? $dependency['host'] : $host[0];
126
+ $path = parse_url( $uri, PHP_URL_PATH );
127
+ $owner_repo = str_replace( '.git', '', trim( $path, '/' ) );
128
+
129
+ switch ( $host ) {
130
+ case ( 'github' ):
131
+ $download_link = 'https://api.github.com/repos/' . $owner_repo . '/zipball/' . $dependency['branch'];
132
+ if ( ! empty( $dependency['token'] ) ) {
133
+ $download_link = add_query_arg( 'access_token', $dependency['token'], $download_link );
134
+ }
135
+ break;
136
+ case ( 'bitbucket' ):
137
+ $download_link = 'https://bitbucket.org/' . $owner_repo . '/get/' . $dependency['branch'] . '.zip';
138
+ break;
139
+ case ( 'gitlab' ):
140
+ $download_link = 'https://gitlab.com/' . $owner_repo . '/repository/archive.zip';
141
+ $download_link = add_query_arg( 'ref', $dependency['branch'], $download_link );
142
+ if ( ! empty( $dependency['token'] ) ) {
143
+ $download_link = add_query_arg( 'private_token', $dependency['token'], $download_link );
144
+ }
145
+ break;
146
+ case( 'wordpress' ):
147
+ $download_link = 'https://downloads.wordpress.org/plugin/' . basename( $owner_repo ) . '.zip';
148
+ break;
149
+ }
150
+
151
+ $this->config[ $slug ]['download_link'] = $download_link;
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Determine if dependency is active or installed.
157
+ */
158
+ public function admin_init() {
159
+ // Initialize Persist admin Notices Dismissal dependency.
160
+ if ( class_exists( 'PaND' ) ) {
161
+ PaND::init();
162
+ }
163
+
164
+ // Get the gears turning.
165
+ $this->apply_config();
166
+
167
+ // Generate admin notices.
168
+ foreach ( $this->config as $slug => $dependency ) {
169
+ $is_optional = ! ( isset( $dependency['optional'] ) && false === $dependency['optional'] );
170
+
171
+ if ( ! $is_optional ) {
172
+ $this->hide_plugin_action_links( $slug );
173
+ }
174
+
175
+ if ( is_plugin_active( $slug ) ) {
176
+ continue;
177
+ }
178
+
179
+ if ( $this->is_installed( $slug ) ) {
180
+ if ( $is_optional ) {
181
+ $this->notices[] = array(
182
+ 'action' => 'activate',
183
+ 'slug' => $slug,
184
+ 'text' => sprintf( __( 'We have detected that although the main %s plugin has been installed, it has not yet been activated.' ), $dependency['name'] ),
185
+ );
186
+
187
+ } else {
188
+ $this->notices[] = $this->activate( $slug );
189
+ }
190
+ } elseif ( $is_optional ) {
191
+ $this->notices[] = array(
192
+ 'action' => 'install',
193
+ 'slug' => $slug,
194
+ 'text' => sprintf( __( 'We have detected that the main %s plugin, has not yet been installed.' ), $dependency['name'] ),
195
+ );
196
+ } else {
197
+ $this->notices[] = $this->install( $slug );
198
+ }
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Register jQuery AJAX.
204
+ */
205
+ public function admin_footer() {
206
+ ?>
207
+ <script>
208
+ (function ($) {
209
+ $(function () {
210
+ $(document).on('click', '.wpdi-button', function () {
211
+ var $this = $(this);
212
+ var $parent = $(this).closest('p');
213
+ $parent.html('Running...');
214
+ $.post(ajaxurl, {
215
+ action: 'dependency_installer',
216
+ method: $this.attr('data-action'),
217
+ slug : $this.attr('data-slug')
218
+ }, function (response) {
219
+ $parent.html(response);
220
+ });
221
+ });
222
+ $(document).on('click', '.dependency-installer .notice-dismiss', function () {
223
+ var $this = $(this);
224
+ $.post(ajaxurl, {
225
+ action: 'dependency_installer',
226
+ method: 'dismiss',
227
+ slug : $this.attr('data-slug')
228
+ });
229
+ });
230
+ });
231
+ })(jQuery);
232
+ </script>
233
+ <?php
234
+ }
235
+
236
+ /**
237
+ * AJAX router.
238
+ */
239
+ public function ajax_router() {
240
+ $method = isset( $_POST['method'] ) ? $_POST['method'] : '';
241
+ $slug = isset( $_POST['slug'] ) ? $_POST['slug'] : '';
242
+ $whitelist = array( 'install', 'activate', 'dismiss' );
243
+
244
+ if ( in_array( $method, $whitelist, true ) ) {
245
+ $response = $this->$method( $slug );
246
+ echo $response['message'];
247
+ }
248
+ wp_die();
249
+ }
250
+
251
+ /**
252
+ * Is dependency installed?
253
+ *
254
+ * @param string $slug Plugin slug.
255
+ *
256
+ * @return boolean
257
+ */
258
+ public function is_installed( $slug ) {
259
+ $plugins = get_plugins();
260
+
261
+ return isset( $plugins[ $slug ] );
262
+ }
263
+
264
+ /**
265
+ * Install and activate dependency.
266
+ *
267
+ * @param string $slug Plugin slug.
268
+ *
269
+ * @return bool|array false or Message.
270
+ */
271
+ public function install( $slug ) {
272
+ if ( $this->is_installed( $slug ) || ! current_user_can( 'update_plugins' ) ) {
273
+ return false;
274
+ }
275
+
276
+ $this->current_slug = $slug;
277
+ add_filter( 'upgrader_source_selection', array( $this, 'upgrader_source_selection' ), 10, 2 );
278
+
279
+ $skin = new WPDI_Plugin_Installer_Skin(
280
+ array(
281
+ 'type' => 'plugin',
282
+ 'nonce' => wp_nonce_url( $this->config[ $slug ]['download_link'] ),
283
+ )
284
+ );
285
+ $upgrader = new Plugin_Upgrader( $skin );
286
+ $result = $upgrader->install( $this->config[ $slug ]['download_link'] );
287
+
288
+ if ( is_wp_error( $result ) ) {
289
+ return array(
290
+ 'status' => 'error',
291
+ 'message' => $result->get_error_message(),
292
+ );
293
+ }
294
+
295
+ wp_cache_flush();
296
+ if ( ! $this->config[ $slug ]['optional'] ) {
297
+ $this->activate( $slug );
298
+
299
+ return array(
300
+ 'status' => 'updated',
301
+ 'slug' => $slug,
302
+ 'message' => sprintf( __( '%s has been installed and activated.' ), $this->config[ $slug ]['name'] ),
303
+ );
304
+
305
+ }
306
+ if ( 'error' === $result['status'] ) {
307
+ return $result;
308
+ }
309
+
310
+ return array(
311
+ 'status' => 'updated',
312
+ 'message' => sprintf( __( '%s has been installed.' ), $this->config[ $slug ]['name'] ),
313
+ );
314
+ }
315
+
316
+ /**
317
+ * Activate dependency.
318
+ *
319
+ * @param string $slug Plugin slug.
320
+ *
321
+ * @return array Message.
322
+ */
323
+ public function activate( $slug ) {
324
+
325
+ // network activate only if on network admin pages.
326
+ $result = is_network_admin() ? activate_plugin( $slug, null, true ) : activate_plugin( $slug );
327
+
328
+ if ( is_wp_error( $result ) ) {
329
+ return array(
330
+ 'status' => 'error',
331
+ 'message' => $result->get_error_message(),
332
+ );
333
+ }
334
+
335
+ return array(
336
+ 'status' => 'updated',
337
+ 'message' => sprintf( __( '%s has been activated.' ), $this->config[ $slug ]['name'] ),
338
+ );
339
+ }
340
+
341
+ /**
342
+ * Dismiss admin notice for a week.
343
+ *
344
+ * @return array Empty Message.
345
+ */
346
+ public function dismiss() {
347
+ return array(
348
+ 'status' => 'updated',
349
+ 'message' => '',
350
+ );
351
+ }
352
+
353
+ /**
354
+ * Correctly rename dependency for activation.
355
+ *
356
+ * @param string $source
357
+ * @param string $remote_source
358
+ *
359
+ * @return string $new_source
360
+ */
361
+ public function upgrader_source_selection( $source, $remote_source ) {
362
+ global $wp_filesystem;
363
+ $new_source = trailingslashit( $remote_source ) . dirname( $this->current_slug );
364
+ $wp_filesystem->move( $source, $new_source );
365
+
366
+ return trailingslashit( $new_source );
367
+ }
368
+
369
+ /**
370
+ * Display admin notices / action links.
371
+ *
372
+ * @return bool/string false or Admin notice.
373
+ */
374
+ public function admin_notices() {
375
+ if ( ! current_user_can( 'update_plugins' ) ) {
376
+ return false;
377
+ }
378
+ $message = null;
379
+ foreach ( $this->notices as $notice ) {
380
+ $status = empty( $notice['status'] ) ? 'notice-info' : $notice['status'];
381
+
382
+ if ( ! empty( $notice['action'] ) ) {
383
+ $action = esc_attr( $notice['action'] );
384
+ $message = esc_html( $notice['text'] );
385
+ $message .= ' <a href="javascript:;" class="wpdi-button" data-action="' . $action . '" data-slug="' . $notice['slug'] . '">' . ucfirst( $action ) . ' Now &raquo;</a>';
386
+ }
387
+ if ( ! empty( $notice['status'] ) ) {
388
+ $message = esc_html( $notice['message'] );
389
+ }
390
+ $dismissible = isset( $notice['slug'] )
391
+ ? 'dependency-installer-' . dirname( $notice['slug'] ) . '-7'
392
+ : null;
393
+ if ( class_exists( '\PAnd' ) && ! \PAnD::is_admin_notice_active( $dismissible ) ) {
394
+ continue;
395
+ }
396
+ ?>
397
+ <div data-dismissible="<?php echo $dismissible; ?>" class="<?php echo $status; ?> notice is-dismissible dependency-installer">
398
+ <p><?php echo '<strong>[' . __( 'Dependency' ) . ']</strong> ' . $message; ?></p>
399
+ </div>
400
+ <?php
401
+ }
402
+ }
403
+
404
+ /**
405
+ * Hide links from plugin row.
406
+ *
407
+ * @param $plugin_file
408
+ */
409
+ public function hide_plugin_action_links( $plugin_file ) {
410
+ add_filter( 'network_admin_plugin_action_links_' . $plugin_file, array( $this, 'unset_action_links' ) );
411
+ add_filter( 'plugin_action_links_' . $plugin_file, array( $this, 'unset_action_links' ) );
412
+ add_action(
413
+ 'after_plugin_row_' . $plugin_file,
414
+ function( $plugin_file ) {
415
+ print( '<script>jQuery(".inactive[data-plugin=\'' . $plugin_file . '\']").attr("class", "active");</script>' );
416
+ print( '<script>jQuery(".active[data-plugin=\'' . $plugin_file . '\'] .check-column input").remove();</script>' );
417
+ }
418
+ );
419
+ }
420
+
421
+ /**
422
+ * Unset plugin action links so mandatory plugins can't be modified.
423
+ *
424
+ * @param $actions
425
+ *
426
+ * @return mixed
427
+ */
428
+ public function unset_action_links( $actions ) {
429
+ if ( isset( $actions['edit'] ) ) {
430
+ unset( $actions['edit'] );
431
+ }
432
+ if ( isset( $actions['delete'] ) ) {
433
+ unset( $actions['delete'] );
434
+ }
435
+ if ( isset( $actions['deactivate'] ) ) {
436
+ unset( $actions['deactivate'] );
437
+ }
438
+
439
+ return array_merge( array( 'required-plugin' => __( 'Plugin dependency' ) ), $actions );
440
+ }
441
+
442
+ }
443
+
444
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
445
+
446
+ /**
447
+ * Class WPDI_Plugin_Installer_Skin
448
+ */
449
+ class WPDI_Plugin_Installer_Skin extends Plugin_Installer_Skin {
450
+ public function header() {}
451
+ public function footer() {}
452
+ public function error( $errors ) {}
453
+ public function feedback( $string ) {}
454
+ }
455
+
456
+ }
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 ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4::getLoader();
vendor/collizo4sky/persist-admin-notices-dismissal/README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Persist Admin notice Dismissals
2
+ [![Latest Stable Version](https://poser.pugx.org/collizo4sky/persist-admin-notices-dismissal/v/stable)](https://packagist.org/packages/collizo4sky/persist-admin-notices-dismissal)
3
+ [![Total Downloads](https://poser.pugx.org/collizo4sky/persist-admin-notices-dismissal/downloads)](https://packagist.org/packages/collizo4sky/persist-admin-notices-dismissal)
4
+
5
+ Simple framework library that persists the dismissal of admin notices across pages in WordPress dashboard.
6
+
7
+ ## Installation
8
+
9
+ Run `composer require collizo4sky/persist-admin-notices-dismissal`
10
+
11
+ Alternatively, clone or download this repo into the `vendor/` folder in your plugin, and include/require the `persist-admin-notices-dismissal.php` file like so
12
+
13
+ ```php
14
+ require __DIR__ . '/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php';
15
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
16
+ ```
17
+
18
+ or let Composer's autoloader do the work.
19
+
20
+ ## How to Use
21
+ Firstly, install and activate this library within a plugin.
22
+
23
+ Say you have the following markup as your admin notice,
24
+
25
+
26
+ ```php
27
+ function sample_admin_notice__success() {
28
+ ?>
29
+ <div class="updated notice notice-success is-dismissible">
30
+ <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
31
+ </div>
32
+ <?php
33
+ }
34
+ add_action( 'admin_notices', 'sample_admin_notice__success' );
35
+ ```
36
+
37
+ To make it hidden forever when dismissed, add the following data attribute `data-dismissible="disable-done-notice-forever"` to the div markup like so:
38
+
39
+
40
+ ```php
41
+ function sample_admin_notice__success() {
42
+ if ( ! PAnD::is_admin_notice_active( 'disable-done-notice-forever' ) ) {
43
+ return;
44
+ }
45
+
46
+ ?>
47
+ <div data-dismissible="disable-done-notice-forever" class="updated notice notice-success is-dismissible">
48
+ <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
49
+ </div>
50
+ <?php
51
+ }
52
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
53
+ add_action( 'admin_notices', 'sample_admin_notice__success' );
54
+ ```
55
+
56
+ ## Autoloaders
57
+ When using the framework with an autoloader you **must** also load the class outside of the `admin_notices` or `network_admin_notices` hooks. The reason is that these hooks come after the `admin_enqueue_script` hook that loads the javascript.
58
+
59
+ Just add the following in your main plugin file.
60
+
61
+ ```php
62
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
63
+ ```
64
+
65
+ #### Usage Instructions and Examples
66
+ If you have two notices displayed when certain actions are triggered; firstly, choose a string to uniquely identify them, e.g. `notice-one` and `notice-two`
67
+
68
+ To make the first notice never appear once dismissed, its `data-dismissible` attribute will be `data-dismissible="notice-one-forever"` where `notice-one` is its unique identifier and `forever` is the dismissal time period.
69
+
70
+ To make the second notice only hidden for 2 days, its `data-dismissible` attribute will be `data-dismissible="notice-two-2"` where `notice-two` is its unique identifier and the `2`, the number of days it will be hidden is the dismissal time period.
71
+
72
+ You **must** append the dismissal time period to the end of your unique identifier with a hyphen (`-`) and this value must be an integer. The only exception is the string `forever`.
73
+
74
+ To actually make the dismissed admin notice not to appear, use the `is_admin_notice_active()` function like so:
75
+
76
+
77
+ ```php
78
+ function sample_admin_notice__success1() {
79
+ if ( ! PAnD::is_admin_notice_active( 'notice-one-forever' ) ) {
80
+ return;
81
+ }
82
+
83
+ ?>
84
+ <div data-dismissible="notice-one-forever" class="updated notice notice-success is-dismissible">
85
+ <p><?php _e( 'Done 1!', 'sample-text-domain' ); ?></p>
86
+ </div>
87
+ <?php
88
+ }
89
+
90
+ function sample_admin_notice__success2() {
91
+ if ( ! PAnD::is_admin_notice_active( 'notice-two-2' ) ) {
92
+ return;
93
+ }
94
+
95
+ ?>
96
+ <div data-dismissible="notice-two-2" class="updated notice notice-success is-dismissible">
97
+ <p><?php _e( 'Done 2!', 'sample-text-domain' ); ?></p>
98
+ </div>
99
+ <?php
100
+ }
101
+
102
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
103
+ add_action( 'admin_notices', 'sample_admin_notice__success1' );
104
+ add_action( 'admin_notices', 'sample_admin_notice__success2' );
105
+ ```
106
+
107
+
108
+ Cool beans. Isn't it?
vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ //shorthand for ready event.
3
+ $(function () {
4
+ $('div[data-dismissible] button.notice-dismiss').click(function (event) {
5
+ event.preventDefault();
6
+ var $this = $(this);
7
+
8
+ var attr_value, option_name, dismissible_length, data;
9
+
10
+ attr_value = $this.parent().attr('data-dismissible').split('-');
11
+
12
+ // remove the dismissible length from the attribute value and rejoin the array.
13
+ dismissible_length = attr_value.pop();
14
+
15
+ option_name = attr_value.join('-');
16
+
17
+ data = {
18
+ 'action': 'dismiss_admin_notice',
19
+ 'option_name': option_name,
20
+ 'dismissible_length': dismissible_length,
21
+ 'nonce': dismissible_notice.nonce
22
+ };
23
+
24
+ // We can also pass the url value separately from ajaxurl for front end AJAX implementations
25
+ $.post(ajaxurl, data);
26
+ });
27
+ })
28
+
29
+ }(jQuery));
vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Persist Admin notices Dismissal
5
+ *
6
+ * Copyright (C) 2016 Agbonghama Collins <http://w3guy.com>
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ * @package Persist Admin notices Dismissal
22
+ * @author Agbonghama Collins
23
+ * @author Andy Fragen
24
+ * @license http://www.gnu.org/licenses GNU General Public License
25
+ * @version 1.3.2
26
+ */
27
+
28
+ /**
29
+ * Exit if called directly.
30
+ */
31
+ if ( ! defined( 'ABSPATH' ) ) {
32
+ die;
33
+ }
34
+
35
+ if ( ! class_exists( 'PAnD' ) ) {
36
+
37
+ /**
38
+ * Class PAnD
39
+ */
40
+ class PAnD {
41
+
42
+ /**
43
+ * Init hooks.
44
+ */
45
+ public static function init() {
46
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_script' ) );
47
+ add_action( 'wp_ajax_dismiss_admin_notice', array( __CLASS__, 'dismiss_admin_notice' ) );
48
+ }
49
+
50
+ /**
51
+ * Enqueue javascript and variables.
52
+ */
53
+ public static function load_script() {
54
+
55
+ if(is_customize_preview()) return;
56
+
57
+ wp_enqueue_script(
58
+ 'dismissible-notices',
59
+ plugins_url( 'dismiss-notice.js', __FILE__ ),
60
+ array( 'jquery', 'common' ),
61
+ false,
62
+ true
63
+ );
64
+
65
+ wp_localize_script(
66
+ 'dismissible-notices',
67
+ 'dismissible_notice',
68
+ array(
69
+ 'nonce' => wp_create_nonce( 'dismissible-notice' ),
70
+ )
71
+ );
72
+ }
73
+
74
+ /**
75
+ * Handles Ajax request to persist notices dismissal.
76
+ * Uses check_ajax_referer to verify nonce.
77
+ */
78
+ public static function dismiss_admin_notice() {
79
+ $option_name = sanitize_text_field( $_POST['option_name'] );
80
+ $dismissible_length = sanitize_text_field( $_POST['dismissible_length'] );
81
+ $transient = 0;
82
+
83
+ if ( 'forever' != $dismissible_length ) {
84
+ // If $dismissible_length is not an integer default to 1
85
+ $dismissible_length = ( 0 == absint( $dismissible_length ) ) ? 1 : $dismissible_length;
86
+ $transient = absint( $dismissible_length ) * DAY_IN_SECONDS;
87
+ $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
88
+ }
89
+
90
+ check_ajax_referer( 'dismissible-notice', 'nonce' );
91
+ set_site_transient( $option_name, $dismissible_length, $transient );
92
+ wp_die();
93
+ }
94
+
95
+ /**
96
+ * Is admin notice active?
97
+ *
98
+ * @param string $arg data-dismissible content of notice.
99
+ *
100
+ * @return bool
101
+ */
102
+ public static function is_admin_notice_active( $arg ) {
103
+ $array = explode( '-', $arg );
104
+ $length = array_pop( $array );
105
+ $option_name = implode( '-', $array );
106
+ $db_record = get_site_transient( $option_name );
107
+
108
+ if ( 'forever' == $db_record ) {
109
+ return false;
110
+ } elseif ( absint( $db_record ) >= time() ) {
111
+ return false;
112
+ } else {
113
+ return true;
114
+ }
115
+ }
116
+
117
+ }
118
+
119
+ }
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+ private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
+
60
+ public function getPrefixes()
61
+ {
62
+ if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
64
+ }
65
+
66
+ return array();
67
+ }
68
+
69
+ public function getPrefixesPsr4()
70
+ {
71
+ return $this->prefixDirsPsr4;
72
+ }
73
+
74
+ public function getFallbackDirs()
75
+ {
76
+ return $this->fallbackDirsPsr0;
77
+ }
78
+
79
+ public function getFallbackDirsPsr4()
80
+ {
81
+ return $this->fallbackDirsPsr4;
82
+ }
83
+
84
+ public function getClassMap()
85
+ {
86
+ return $this->classMap;
87
+ }
88
+
89
+ /**
90
+ * @param array $classMap Class to filename map
91
+ */
92
+ public function addClassMap(array $classMap)
93
+ {
94
+ if ($this->classMap) {
95
+ $this->classMap = array_merge($this->classMap, $classMap);
96
+ } else {
97
+ $this->classMap = $classMap;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Registers a set of PSR-0 directories for a given prefix, either
103
+ * appending or prepending to the ones previously set for this prefix.
104
+ *
105
+ * @param string $prefix The prefix
106
+ * @param array|string $paths The PSR-0 root directories
107
+ * @param bool $prepend Whether to prepend the directories
108
+ */
109
+ public function add($prefix, $paths, $prepend = false)
110
+ {
111
+ if (!$prefix) {
112
+ if ($prepend) {
113
+ $this->fallbackDirsPsr0 = array_merge(
114
+ (array) $paths,
115
+ $this->fallbackDirsPsr0
116
+ );
117
+ } else {
118
+ $this->fallbackDirsPsr0 = array_merge(
119
+ $this->fallbackDirsPsr0,
120
+ (array) $paths
121
+ );
122
+ }
123
+
124
+ return;
125
+ }
126
+
127
+ $first = $prefix[0];
128
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
+
131
+ return;
132
+ }
133
+ if ($prepend) {
134
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
135
+ (array) $paths,
136
+ $this->prefixesPsr0[$first][$prefix]
137
+ );
138
+ } else {
139
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
140
+ $this->prefixesPsr0[$first][$prefix],
141
+ (array) $paths
142
+ );
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Registers a set of PSR-4 directories for a given namespace, either
148
+ * appending or prepending to the ones previously set for this namespace.
149
+ *
150
+ * @param string $prefix The prefix/namespace, with trailing '\\'
151
+ * @param array|string $paths The PSR-4 base directories
152
+ * @param bool $prepend Whether to prepend the directories
153
+ *
154
+ * @throws \InvalidArgumentException
155
+ */
156
+ public function addPsr4($prefix, $paths, $prepend = false)
157
+ {
158
+ if (!$prefix) {
159
+ // Register directories for the root namespace.
160
+ if ($prepend) {
161
+ $this->fallbackDirsPsr4 = array_merge(
162
+ (array) $paths,
163
+ $this->fallbackDirsPsr4
164
+ );
165
+ } else {
166
+ $this->fallbackDirsPsr4 = array_merge(
167
+ $this->fallbackDirsPsr4,
168
+ (array) $paths
169
+ );
170
+ }
171
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
+ // Register directories for a new namespace.
173
+ $length = strlen($prefix);
174
+ if ('\\' !== $prefix[$length - 1]) {
175
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
+ }
177
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
+ } elseif ($prepend) {
180
+ // Prepend directories for an already registered namespace.
181
+ $this->prefixDirsPsr4[$prefix] = array_merge(
182
+ (array) $paths,
183
+ $this->prefixDirsPsr4[$prefix]
184
+ );
185
+ } else {
186
+ // Append directories for an already registered namespace.
187
+ $this->prefixDirsPsr4[$prefix] = array_merge(
188
+ $this->prefixDirsPsr4[$prefix],
189
+ (array) $paths
190
+ );
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Registers a set of PSR-0 directories for a given prefix,
196
+ * replacing any others previously set for this prefix.
197
+ *
198
+ * @param string $prefix The prefix
199
+ * @param array|string $paths The PSR-0 base directories
200
+ */
201
+ public function set($prefix, $paths)
202
+ {
203
+ if (!$prefix) {
204
+ $this->fallbackDirsPsr0 = (array) $paths;
205
+ } else {
206
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Registers a set of PSR-4 directories for a given namespace,
212
+ * replacing any others previously set for this namespace.
213
+ *
214
+ * @param string $prefix The prefix/namespace, with trailing '\\'
215
+ * @param array|string $paths The PSR-4 base directories
216
+ *
217
+ * @throws \InvalidArgumentException
218
+ */
219
+ public function setPsr4($prefix, $paths)
220
+ {
221
+ if (!$prefix) {
222
+ $this->fallbackDirsPsr4 = (array) $paths;
223
+ } else {
224
+ $length = strlen($prefix);
225
+ if ('\\' !== $prefix[$length - 1]) {
226
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
+ }
228
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Turns on searching the include path for class files.
235
+ *
236
+ * @param bool $useIncludePath
237
+ */
238
+ public function setUseIncludePath($useIncludePath)
239
+ {
240
+ $this->useIncludePath = $useIncludePath;
241
+ }
242
+
243
+ /**
244
+ * Can be used to check if the autoloader uses the include path to check
245
+ * for classes.
246
+ *
247
+ * @return bool
248
+ */
249
+ public function getUseIncludePath()
250
+ {
251
+ return $this->useIncludePath;
252
+ }
253
+
254
+ /**
255
+ * Turns off searching the prefix and fallback directories for classes
256
+ * that have not been registered with the class map.
257
+ *
258
+ * @param bool $classMapAuthoritative
259
+ */
260
+ public function setClassMapAuthoritative($classMapAuthoritative)
261
+ {
262
+ $this->classMapAuthoritative = $classMapAuthoritative;
263
+ }
264
+
265
+ /**
266
+ * Should class lookup fail if not found in the current class map?
267
+ *
268
+ * @return bool
269
+ */
270
+ public function isClassMapAuthoritative()
271
+ {
272
+ return $this->classMapAuthoritative;
273
+ }
274
+
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
+ /**
296
+ * Registers this instance as an autoloader.
297
+ *
298
+ * @param bool $prepend Whether to prepend the autoloader or not
299
+ */
300
+ public function register($prepend = false)
301
+ {
302
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
+ }
304
+
305
+ /**
306
+ * Unregisters this instance as an autoloader.
307
+ */
308
+ public function unregister()
309
+ {
310
+ spl_autoload_unregister(array($this, 'loadClass'));
311
+ }
312
+
313
+ /**
314
+ * Loads the given class or interface.
315
+ *
316
+ * @param string $class The name of the class
317
+ * @return bool|null True if loaded, null otherwise
318
+ */
319
+ public function loadClass($class)
320
+ {
321
+ if ($file = $this->findFile($class)) {
322
+ includeFile($file);
323
+
324
+ return true;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Finds the path to the file where the class is defined.
330
+ *
331
+ * @param string $class The name of the class
332
+ *
333
+ * @return string|false The path if found, false otherwise
334
+ */
335
+ public function findFile($class)
336
+ {
337
+ // class map lookup
338
+ if (isset($this->classMap[$class])) {
339
+ return $this->classMap[$class];
340
+ }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
+ return false;
343
+ }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
+
351
+ $file = $this->findFileWithExtension($class, '.php');
352
+
353
+ // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
+ $file = $this->findFileWithExtension($class, '.hh');
356
+ }
357
+
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
+ // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
+ }
366
+
367
+ return $file;
368
+ }
369
+
370
+ private function findFileWithExtension($class, $ext)
371
+ {
372
+ // PSR-4 lookup
373
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
+
375
+ $first = $class[0];
376
+ if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath.'\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
+ $length = $this->prefixLengthsPsr4[$first][$search];
384
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
+ return $file;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+
392
+ // PSR-4 fallback dirs
393
+ foreach ($this->fallbackDirsPsr4 as $dir) {
394
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
+ return $file;
396
+ }
397
+ }
398
+
399
+ // PSR-0 lookup
400
+ if (false !== $pos = strrpos($class, '\\')) {
401
+ // namespaced class name
402
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
+ } else {
405
+ // PEAR-like class name
406
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
+ }
408
+
409
+ if (isset($this->prefixesPsr0[$first])) {
410
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
+ if (0 === strpos($class, $prefix)) {
412
+ foreach ($dirs as $dir) {
413
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
+ return $file;
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ // PSR-0 fallback dirs
422
+ foreach ($this->fallbackDirsPsr0 as $dir) {
423
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
+ return $file;
425
+ }
426
+ }
427
+
428
+ // PSR-0 include paths.
429
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
+ return $file;
431
+ }
432
+
433
+ return false;
434
+ }
435
+ }
436
+
437
+ /**
438
+ * Scope isolated include.
439
+ *
440
+ * Prevents access to $this/self from included files.
441
+ */
442
+ function includeFile($file)
443
+ {
444
+ include $file;
445
+ }
vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_files.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_files.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'f51bb131284ceb3bf7d980d1de33e647' => $vendorDir . '/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
10
+ '35bd6a751b552e7a94ae27bc4c52b33a' => $vendorDir . '/afragen/wp-dependency-installer/wp-dependency-installer.php',
11
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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
+ 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
10
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4
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('ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit7bccf5ae526588cfb1b3cd6112f8e2a4', 'loadClassLoader'));
25
+
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
+ if ($useStaticLoader) {
28
+ require_once __DIR__ . '/autoload_static.php';
29
+
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::getInitializer($loader));
31
+ } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
+
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
+ $classMap = require __DIR__ . '/autoload_classmap.php';
43
+ if ($classMap) {
44
+ $loader->addClassMap($classMap);
45
+ }
46
+ }
47
+
48
+ $loader->register(true);
49
+
50
+ if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$files;
52
+ } else {
53
+ $includeFiles = require __DIR__ . '/autoload_files.php';
54
+ }
55
+ foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire7bccf5ae526588cfb1b3cd6112f8e2a4($fileIdentifier, $file);
57
+ }
58
+
59
+ return $loader;
60
+ }
61
+ }
62
+
63
+ function composerRequire7bccf5ae526588cfb1b3cd6112f8e2a4($fileIdentifier, $file)
64
+ {
65
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
+ require $file;
67
+
68
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
+ }
70
+ }
vendor/composer/autoload_static.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4
8
+ {
9
+ public static $files = array (
10
+ 'f51bb131284ceb3bf7d980d1de33e647' => __DIR__ . '/..' . '/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
11
+ '35bd6a751b552e7a94ae27bc4c52b33a' => __DIR__ . '/..' . '/afragen/wp-dependency-installer/wp-dependency-installer.php',
12
+ );
13
+
14
+ public static $prefixLengthsPsr4 = array (
15
+ 'C' =>
16
+ array (
17
+ 'Composer\\Installers\\' => 20,
18
+ ),
19
+ );
20
+
21
+ public static $prefixDirsPsr4 = array (
22
+ 'Composer\\Installers\\' =>
23
+ array (
24
+ 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
25
+ ),
26
+ );
27
+
28
+ public static function getInitializer(ClassLoader $loader)
29
+ {
30
+ return \Closure::bind(function () use ($loader) {
31
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$prefixLengthsPsr4;
32
+ $loader->prefixDirsPsr4 = ComposerStaticInit7bccf5ae526588cfb1b3cd6112f8e2a4::$prefixDirsPsr4;
33
+
34
+ }, null, ClassLoader::class);
35
+ }
36
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "composer/installers",
4
+ "version": "v1.5.0",
5
+ "version_normalized": "1.5.0.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/composer/installers.git",
9
+ "reference": "049797d727261bf27f2690430d935067710049c2"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2",
14
+ "reference": "049797d727261bf27f2690430d935067710049c2",
15
+ "shasum": ""
16
+ },
17
+ "require": {
18
+ "composer-plugin-api": "^1.0"
19
+ },
20
+ "replace": {
21
+ "roundcube/plugin-installer": "*",
22
+ "shama/baton": "*"
23
+ },
24
+ "require-dev": {
25
+ "composer/composer": "1.0.*@dev",
26
+ "phpunit/phpunit": "^4.8.36"
27
+ },
28
+ "time": "2017-12-29T09:13:20+00:00",
29
+ "type": "composer-plugin",
30
+ "extra": {
31
+ "class": "Composer\\Installers\\Plugin",
32
+ "branch-alias": {
33
+ "dev-master": "1.0-dev"
34
+ }
35
+ },
36
+ "installation-source": "dist",
37
+ "autoload": {
38
+ "psr-4": {
39
+ "Composer\\Installers\\": "src/Composer/Installers"
40
+ }
41
+ },
42
+ "notification-url": "https://packagist.org/downloads/",
43
+ "license": [
44
+ "MIT"
45
+ ],
46
+ "authors": [
47
+ {
48
+ "name": "Kyle Robinson Young",
49
+ "email": "kyle@dontkry.com",
50
+ "homepage": "https://github.com/shama"
51
+ }
52
+ ],
53
+ "description": "A multi-framework Composer library installer",
54
+ "homepage": "https://composer.github.io/installers/",
55
+ "keywords": [
56
+ "Craft",
57
+ "Dolibarr",
58
+ "Eliasis",
59
+ "Hurad",
60
+ "ImageCMS",
61
+ "Kanboard",
62
+ "Lan Management System",
63
+ "MODX Evo",
64
+ "Mautic",
65
+ "Maya",
66
+ "OXID",
67
+ "Plentymarkets",
68
+ "Porto",
69
+ "RadPHP",
70
+ "SMF",
71
+ "Thelia",
72
+ "WolfCMS",
73
+ "agl",
74
+ "aimeos",
75
+ "annotatecms",
76
+ "attogram",
77
+ "bitrix",
78
+ "cakephp",
79
+ "chef",
80
+ "cockpit",
81
+ "codeigniter",
82
+ "concrete5",
83
+ "croogo",
84
+ "dokuwiki",
85
+ "drupal",
86
+ "eZ Platform",
87
+ "elgg",
88
+ "expressionengine",
89
+ "fuelphp",
90
+ "grav",
91
+ "installer",
92
+ "itop",
93
+ "joomla",
94
+ "kohana",
95
+ "laravel",
96
+ "lavalite",
97
+ "lithium",
98
+ "magento",
99
+ "majima",
100
+ "mako",
101
+ "mediawiki",
102
+ "modulework",
103
+ "modx",
104
+ "moodle",
105
+ "osclass",
106
+ "phpbb",
107
+ "piwik",
108
+ "ppi",
109
+ "puppet",
110
+ "pxcms",
111
+ "reindex",
112
+ "roundcube",
113
+ "shopware",
114
+ "silverstripe",
115
+ "sydes",
116
+ "symfony",
117
+ "typo3",
118
+ "wordpress",
119
+ "yawik",
120
+ "zend",
121
+ "zikula"
122
+ ]
123
+ },
124
+ {
125
+ "name": "collizo4sky/persist-admin-notices-dismissal",
126
+ "version": "1.3.2",
127
+ "version_normalized": "1.3.2.0",
128
+ "source": {
129
+ "type": "git",
130
+ "url": "https://github.com/collizo4sky/persist-admin-notices-dismissal.git",
131
+ "reference": "b80673631d14f10af9747283d08434619232c003"
132
+ },
133
+ "dist": {
134
+ "type": "zip",
135
+ "url": "https://api.github.com/repos/collizo4sky/persist-admin-notices-dismissal/zipball/b80673631d14f10af9747283d08434619232c003",
136
+ "reference": "b80673631d14f10af9747283d08434619232c003",
137
+ "shasum": ""
138
+ },
139
+ "time": "2018-01-23T03:14:06+00:00",
140
+ "type": "library",
141
+ "installation-source": "dist",
142
+ "autoload": {
143
+ "files": [
144
+ "persist-admin-notices-dismissal.php"
145
+ ]
146
+ },
147
+ "notification-url": "https://packagist.org/downloads/",
148
+ "authors": [
149
+ {
150
+ "name": "Collins Agbonghama",
151
+ "email": "me@w3guy.com"
152
+ }
153
+ ],
154
+ "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard."
155
+ },
156
+ {
157
+ "name": "afragen/wp-dependency-installer",
158
+ "version": "1.3.3",
159
+ "version_normalized": "1.3.3.0",
160
+ "source": {
161
+ "type": "git",
162
+ "url": "https://github.com/afragen/wp-dependency-installer.git",
163
+ "reference": "7779d63050377d90f8fceaec9fea7cd62dc8bbc0"
164
+ },
165
+ "dist": {
166
+ "type": "zip",
167
+ "url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/7779d63050377d90f8fceaec9fea7cd62dc8bbc0",
168
+ "reference": "7779d63050377d90f8fceaec9fea7cd62dc8bbc0",
169
+ "shasum": ""
170
+ },
171
+ "require": {
172
+ "collizo4sky/persist-admin-notices-dismissal": ">=1.3",
173
+ "composer/installers": "^1.0",
174
+ "php": ">=5.3"
175
+ },
176
+ "time": "2018-06-19T21:24:01+00:00",
177
+ "type": "library",
178
+ "installation-source": "dist",
179
+ "autoload": {
180
+ "files": [
181
+ "wp-dependency-installer.php"
182
+ ]
183
+ },
184
+ "notification-url": "https://packagist.org/downloads/",
185
+ "license": [
186
+ "MIT"
187
+ ],
188
+ "authors": [
189
+ {
190
+ "name": "Matt Gibbs",
191
+ "role": "Developer"
192
+ },
193
+ {
194
+ "name": "Andy Fragen",
195
+ "email": "andy@thefragens.com",
196
+ "homepage": "https://thefragens.com",
197
+ "role": "Developer"
198
+ }
199
+ ],
200
+ "description": "Library that helps WordPress plugin dependency management."
201
+ }
202
+ ]
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,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+
3
+ sudo: false
4
+
5
+ dist: trusty
6
+
7
+ git:
8
+ depth: 5
9
+
10
+ php:
11
+ - 5.4
12
+ - 5.5
13
+ - 5.6
14
+ - 7.0
15
+ - 7.1
16
+ - 7.2
17
+ - hhvm
18
+ - nightly
19
+
20
+ matrix:
21
+ include:
22
+ - dist: precise
23
+ php: 5.3
24
+ fast_finish: true
25
+ allow_failures:
26
+ - php: nightly
27
+
28
+ before_script:
29
+ - composer self-update
30
+ - composer install
31
+
32
+ script:
33
+ - composer test
vendor/composer/installers/CHANGELOG.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Change Log
2
+
3
+ ## [Unreleased]
4
+
5
+ ## v1.5.0 - 2017-12-29
6
+ ### Added
7
+ * Added WordPress dropin support.
8
+ * Added new types supported for Eliasis.
9
+ * Added support for Phoenix CMS.
10
+ * Added MODX installer.
11
+ * Added Majima instaler.
12
+ * Added SiteDirect installer.
13
+ * Added support optional prefix in OctoberCMS installers.
14
+ * Added PHP 7.2 support.
15
+
16
+ ### Changed
17
+ * Changed remove packages, see [#348](https://github.com/composer/installers/pull/348).
18
+
19
+ ### Fixed
20
+ * Fixed code style, removed unused imports.
21
+
22
+ ## v1.4.0 - 2017-08-09
23
+ ### Added
24
+ * Installer for eZ Platform.
25
+ * Installer for UserFrosting.
26
+ * Installer for Osclass.
27
+ * Installer for Lan Management System.
28
+
29
+ ### Changed
30
+ * Added vendor name to package path for Lavalite.
31
+
32
+ ## v1.3.0 - 2017-04-24
33
+ ### Added
34
+ * Kanboard plugins installer.
35
+ * Porto-SAP installer.
36
+ * Add `core` to concrete5 installer.
37
+ * Support Moodle "search" plugin type.
38
+ * SyDES installer.
39
+ * iTop installer.
40
+ * Lavalite installer.
41
+ * Module type for Eliasis.
42
+ * Vgmcp installer.
43
+ * OntoWiki installer.
44
+ * The requirements for contributing (CONTRIBUTING.md).
45
+
46
+ ## v1.2.0 - 2016-08-13
47
+ ### Added
48
+ * Installer for Attogram.
49
+ * Installer for Cockpit.
50
+ * Installer for Plentymarkets.
51
+ * Installer for ReIndex.
52
+ * Installer for Vanilla.
53
+ * Installer for YAWIK.
54
+ * Added missing environments for new Shopware (5.2) Plugin System.
55
+
56
+ ## v1.1.0 - 2016-07-05
57
+ ### Added
58
+ * Installer for ReIndex.
59
+ * Installer for RadPHP.
60
+ * Installer for Decibel.
61
+ * Installer for Phifty.
62
+ * Installer for ExpressionEngine.
63
+
64
+ ### Changed
65
+ * New paths for new Bitrix CMS. Old paths is deprecated.
66
+
67
+ ### Deprecated
68
+ * Old paths in Bitrix CMS Installer is deprecated.
69
+
70
+ ## v1.0.25 - 2016-04-13
71
+ ### Removed
72
+ * Revert TYPO3 installer deletion.
73
+
74
+ ## v1.0.24 - 2016-04-05
75
+ ### Added
76
+ * Installer for ImageCMS.
77
+ * Installer for Mautic.
78
+ * New types in the Kirby installer: `kirby-plugin` and `kirby-field`.
79
+ * New types in the Drupal installer: `custom-theme` and `custom-module`.
80
+
81
+ ### Changed
82
+ * Switch to PSR-4.
83
+ * Update Bitrix Installer: configuration for setting custom path to directory with kernel.
84
+
85
+ ### Removed
86
+ * Remove TYPO3 Extension installers.
vendor/composer/installers/CONTRIBUTING.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing
2
+
3
+ If you would like to help, please take a look at the list of
4
+ [issues](https://github.com/composer/installers/issues).
5
+
6
+ ## Pull requests
7
+
8
+ * [Fork and clone](https://help.github.com/articles/fork-a-repo).
9
+ * Run the command `php composer.phar install` to install the dependencies.
10
+ This will also install the dev dependencies. See [Composer](https://getcomposer.org/doc/03-cli.md#install).
11
+ * Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
12
+ * Create a branch, commit, push and send us a
13
+ [pull request](https://help.github.com/articles/using-pull-requests).
14
+
15
+ To ensure a consistent code base, you should make sure the code follows the
16
+ coding standards [PSR-1](http://www.php-fig.org/psr/psr-1/) and
17
+ [PSR-2](http://www.php-fig.org/psr/psr-2/).
18
+
19
+ ### Create a new Installer
20
+
21
+ * Create class extends `Composer\Installers\BaseInstaller` with your Installer.
22
+ * Create unit tests as a separate class or as part of a `Composer\Installers\Test\InstallerTest`.
23
+ * Add information about your Installer in `README.md` in section "Current Supported Package Types".
24
+ * Run the tests.
vendor/composer/installers/LICENSE 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,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
2
+
3
+ [![Build Status](http://img.shields.io/travis/composer/installers.svg)](http://travis-ci.org/composer/installers)
4
+
5
+ This is for PHP package authors to require in their `composer.json`. It will
6
+ install their package to the correct location based on the specified package
7
+ type.
8
+
9
+ The goal of Installers is to be a simple package type to install path map.
10
+ Users can also customize the install path per package and package authors can
11
+ modify the package name upon installing.
12
+
13
+ Installers isn't intended on replacing all custom installers. If your
14
+ package requires special installation handling then by all means, create a
15
+ custom installer to handle it.
16
+
17
+ **Natively Supported Frameworks**:
18
+
19
+ The following frameworks natively work with Composer and will be
20
+ installed to the default `vendor` directory. `composer/installers`
21
+ is not needed to install packages with these frameworks:
22
+
23
+ * Aura
24
+ * Symfony2
25
+ * Yii
26
+ * Yii2
27
+
28
+ ## Current Supported Package Types
29
+
30
+ > Stable types are marked as **bold**, this means that installation paths
31
+ > for those type will not be changed. Any adjustment for those types would
32
+ > require creation of brand new type that will cover required changes.
33
+
34
+ | Framework | Types
35
+ | --------- | -----
36
+ | Aimeos | `aimeos-extension`
37
+ | Asgard | `asgard-module`<br>`asgard-theme`
38
+ | Attogram | `attogram-module`
39
+ | AGL | `agl-module`
40
+ | Bonefish | `bonefish-package`
41
+ | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
42
+ | Bitrix | `bitrix-module` (deprecated) <br>`bitrix-component` (deprecated) <br>`bitrix-theme` (deprecated) <br><br> `bitrix-d7-module` <br> `bitrix-d7-component` <br> `bitrix-d7-template`
43
+ | CakePHP 2+ | **`cakephp-plugin`**
44
+ | Chef | `chef-cookbook`<br>`chef-role`
45
+ | CCFramework | `ccframework-ship`<br>`ccframework-theme`
46
+ | Cockpit | `cockpit-module`
47
+ | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
48
+ | concrete5 | `concrete5-core`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-block`<br>`concrete5-update`
49
+ | Craft | `craft-plugin`
50
+ | Croogo | `croogo-plugin`<br>`croogo-theme`
51
+ | Decibel | `decibel-app`
52
+ | DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
53
+ | Dolibarr | `dolibarr-module`
54
+ | Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
55
+ | Elgg | `elgg-plugin`
56
+ | Eliasis | `eliasis-component`<br>`eliasis-module`<br>`eliasis-plugin`<br>`eliasis-template`
57
+ | ExpressionEngine 3 | `ee3-addon`<br>`ee3-theme`
58
+ | eZ Platform | `ezplatform-assets`<br>`ezplatform-meta-assets`
59
+ | FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
60
+ | FuelPHP v2.x | `fuelphp-component`
61
+ | Grav | `grav-plugin`<br>`grav-theme`
62
+ | Hurad | `hurad-plugin`<br>`hurad-theme`
63
+ | ImageCMS | `imagecms-template`<br>`imagecms-module`<br>`imagecms-library`
64
+ | iTop | `itop-extension`
65
+ | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
66
+ | Kanboard | `kanboard-plugin`
67
+ | Kirby | **`kirby-plugin`**<br>`kirby-field`<br>`kirby-tag`
68
+ | KodiCMS | `kodicms-plugin`<br>`kodicms-media`
69
+ | Kohana | **`kohana-module`**
70
+ | Lan Management System | `lms-plugin`<br>`lms-template`<br>`lms-document-template`<br>`lms-userpanel-module`
71
+ | Laravel | `laravel-library`
72
+ | Lavalite | `lavalite-theme`<br>`lavalite-package`
73
+ | Lithium | **`lithium-library`<br>`lithium-source`**
74
+ | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
75
+ | majima | `majima-plugin`
76
+ | Mako | `mako-package`
77
+ | Mautic | `mautic-plugin`<br>`mautic-theme`
78
+ | Maya | `maya-module`
79
+ | MODX | `modx-extra`
80
+ | MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
81
+ | MediaWiki | `mediawiki-extension`
82
+ | October | **`october-module`<br>`october-plugin`<br>`october-theme`**
83
+ | OntoWiki | `ontowiki-extension`<br>`ontowiki-theme`<br>`ontowiki-translation`
84
+ | OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
85
+ | Osclass | `osclass-plugin`<br>`osclass-theme`<br>`osclass-language`
86
+ | MODULEWork | `modulework-module`
87
+ | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
88
+ | Piwik | `piwik-plugin`
89
+ | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
90
+ | Pimcore | `pimcore-plugin`
91
+ | Plentymarkets | `plentymarkets-plugin`
92
+ | PPI | **`ppi-module`**
93
+ | Puppet | `puppet-module`
94
+ | Porto | `porto-container`
95
+ | RadPHP | `radphp-bundle`
96
+ | REDAXO | `redaxo-addon`
97
+ | ReIndex | **`reindex-plugin`** <br> **`reindex-theme`**
98
+ | Roundcube | `roundcube-plugin`
99
+ | shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`<br/>`shopware-plugin`<br/>`shopware-frontend-theme`
100
+ | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
101
+ | SiteDirect | `sitedirect-module`<br>`sitedirect-plugin`
102
+ | SMF | `smf-module`<br>`smf-theme`
103
+ | SyDES | `sydes-module`<br>`sydes-theme`
104
+ | symfony1 | **`symfony1-plugin`**
105
+ | Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
106
+ | TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
107
+ | TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
108
+ | UserFrosting | `userfrosting-sprinkle`
109
+ | Vanilla | `vanilla-plugin`<br>`vanilla-theme`
110
+ | Vgmcp | `vgmcp-bundle`<br>`vgmcp-theme`
111
+ | Wolf CMS | `wolfcms-plugin`
112
+ | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`<br>`wordpress-dropin`
113
+ | YAWIK | `yawik-module`
114
+ | Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
115
+ | Zikula | `zikula-module`<br>`zikula-theme`
116
+ | Prestashop | `prestashop-module`<br>`prestashop-theme`
117
+ | Phifty | `phifty-bundle`<br>`phifty-framework`<br>`phifty-library`
118
+
119
+ ## Example `composer.json` File
120
+
121
+ This is an example for a CakePHP plugin. The only important parts to set in your
122
+ composer.json file are `"type": "cakephp-plugin"` which describes what your
123
+ package is and `"require": { "composer/installers": "~1.0" }` which tells composer
124
+ to load the custom installers.
125
+
126
+ ```json
127
+ {
128
+ "name": "you/ftp",
129
+ "type": "cakephp-plugin",
130
+ "require": {
131
+ "composer/installers": "~1.0"
132
+ }
133
+ }
134
+ ```
135
+
136
+ This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
137
+ when a user runs `php composer.phar install`.
138
+
139
+ So submit your packages to [packagist.org](http://packagist.org)!
140
+
141
+ ## Custom Install Paths
142
+
143
+ If you are consuming a package that uses the `composer/installers` you can
144
+ override the install path with the following extra in your `composer.json`:
145
+
146
+ ```json
147
+ {
148
+ "extra": {
149
+ "installer-paths": {
150
+ "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ A package type can have a custom installation path with a `type:` prefix.
157
+
158
+ ``` json
159
+ {
160
+ "extra": {
161
+ "installer-paths": {
162
+ "your/custom/path/{$name}/": ["type:wordpress-plugin"]
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ You can also have the same vendor packages with a custom installation path by
169
+ using the `vendor:` prefix.
170
+
171
+ ``` json
172
+ {
173
+ "extra": {
174
+ "installer-paths": {
175
+ "your/custom/path/{$name}/": ["vendor:my_organization"]
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ These would use your custom path for each of the listed packages. The available
182
+ variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
183
+
184
+ ## Custom Install Names
185
+
186
+ If you're a package author and need your package to be named differently when
187
+ installed consider using the `installer-name` extra.
188
+
189
+ For example you have a package named `shama/cakephp-ftp` with the type
190
+ `cakephp-plugin`. Installing with `composer/installers` would install to the
191
+ path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
192
+ package author actually need the package to be named and installed to
193
+ `Plugin/Ftp`. Using the following config within your **package** `composer.json`
194
+ will allow this:
195
+
196
+ ```json
197
+ {
198
+ "name": "shama/cakephp-ftp",
199
+ "type": "cakephp-plugin",
200
+ "extra": {
201
+ "installer-name": "Ftp"
202
+ }
203
+ }
204
+ ```
205
+
206
+ Please note the name entered into `installer-name` will be the final and will
207
+ not be inflected.
208
+
209
+ ## Should we allow dynamic package types or paths? No.
210
+
211
+ What are they? The ability for a package author to determine where a package
212
+ will be installed either through setting the path directly in their
213
+ `composer.json` or through a dynamic package type: `"type":
214
+ "framework-install-here"`.
215
+
216
+ It has been proposed many times. Even implemented once early on and then
217
+ removed. Installers won't do this because it would allow a single package
218
+ author to wipe out entire folders without the user's consent. That user would
219
+ then come here to yell at us.
220
+
221
+ Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.
vendor/composer/installers/_config.yml ADDED
@@ -0,0 +1 @@
 
1
+ theme: jekyll-theme-cayman
vendor/composer/installers/composer.json ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "composer/installers",
3
+ "type": "composer-plugin",
4
+ "license": "MIT",
5
+ "description": "A multi-framework Composer library installer",
6
+ "keywords": [
7
+ "installer",
8
+ "Aimeos",
9
+ "AGL",
10
+ "AnnotateCms",
11
+ "Attogram",
12
+ "Bitrix",
13
+ "CakePHP",
14
+ "Chef",
15
+ "Cockpit",
16
+ "CodeIgniter",
17
+ "concrete5",
18
+ "Craft",
19
+ "Croogo",
20
+ "DokuWiki",
21
+ "Dolibarr",
22
+ "Drupal",
23
+ "Elgg",
24
+ "Eliasis",
25
+ "ExpressionEngine",
26
+ "eZ Platform",
27
+ "FuelPHP",
28
+ "Grav",
29
+ "Hurad",
30
+ "ImageCMS",
31
+ "iTop",
32
+ "Joomla",
33
+ "Kanboard",
34
+ "Kohana",
35
+ "Lan Management System",
36
+ "Laravel",
37
+ "Lavalite",
38
+ "Lithium",
39
+ "Magento",
40
+ "majima",
41
+ "Mako",
42
+ "Mautic",
43
+ "Maya",
44
+ "MODX",
45
+ "MODX Evo",
46
+ "MediaWiki",
47
+ "OXID",
48
+ "osclass",
49
+ "MODULEWork",
50
+ "Moodle",
51
+ "Piwik",
52
+ "pxcms",
53
+ "phpBB",
54
+ "Plentymarkets",
55
+ "PPI",
56
+ "Puppet",
57
+ "Porto",
58
+ "RadPHP",
59
+ "ReIndex",
60
+ "Roundcube",
61
+ "shopware",
62
+ "SilverStripe",
63
+ "SMF",
64
+ "SyDES",
65
+ "symfony",
66
+ "Thelia",
67
+ "TYPO3",
68
+ "WolfCMS",
69
+ "WordPress",
70
+ "YAWIK",
71
+ "Zend",
72
+ "Zikula"
73
+ ],
74
+ "homepage": "https://composer.github.io/installers/",
75
+ "authors": [
76
+ {
77
+ "name": "Kyle Robinson Young",
78
+ "email": "kyle@dontkry.com",
79
+ "homepage": "https://github.com/shama"
80
+ }
81
+ ],
82
+ "autoload": {
83
+ "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
84
+ },
85
+ "extra": {
86
+ "class": "Composer\\Installers\\Plugin",
87
+ "branch-alias": {
88
+ "dev-master": "1.0-dev"
89
+ }
90
+ },
91
+ "replace": {
92
+ "shama/baton": "*",
93
+ "roundcube/plugin-installer": "*"
94
+ },
95
+ "require": {
96
+ "composer-plugin-api": "^1.0"
97
+ },
98
+ "require-dev": {
99
+ "composer/composer": "1.0.*@dev",
100
+ "phpunit/phpunit": "^4.8.36"
101
+ },
102
+ "scripts": {
103
+ "test": "phpunit"
104
+ }
105
+ }
vendor/composer/installers/phpunit.xml.dist 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/AimeosInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AimeosInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'ext/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AnnotateCmsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'addons/modules/{$name}/',
8
+ 'component' => 'addons/components/{$name}/',
9
+ 'service' => 'addons/services/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AsgardInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'Modules/{$name}/',
8
+ 'theme' => 'Themes/{$name}/'
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type asgard-module, cut off a trailing '-plugin' if present.
15
+ *
16
+ * For package type asgard-theme, cut off a trailing '-theme' if present.
17
+ *
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] === 'asgard-module') {
22
+ return $this->inflectPluginVars($vars);
23
+ }
24
+
25
+ if ($vars['type'] === 'asgard-theme') {
26
+ return $this->inflectThemeVars($vars);
27
+ }
28
+
29
+ return $vars;
30
+ }
31
+
32
+ protected function inflectPluginVars($vars)
33
+ {
34
+ $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
35
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
+
38
+ return $vars;
39
+ }
40
+
41
+ protected function inflectThemeVars($vars)
42
+ {
43
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
+
47
+ return $vars;
48
+ }
49
+ }
vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AttogramInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\IO\IOInterface;
5
+ use Composer\Composer;
6
+ use Composer\Package\PackageInterface;
7
+
8
+ abstract class BaseInstaller
9
+ {
10
+ protected $locations = array();
11
+ protected $composer;
12
+ protected $package;
13
+ protected $io;
14
+
15
+ /**
16
+ * Initializes base installer.
17
+ *
18
+ * @param PackageInterface $package
19
+ * @param Composer $composer
20
+ * @param IOInterface $io
21
+ */
22
+ public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
23
+ {
24
+ $this->composer = $composer;
25
+ $this->package = $package;
26
+ $this->io = $io;
27
+ }
28
+
29
+ /**
30
+ * Return the install path based on package type.
31
+ *
32
+ * @param PackageInterface $package
33
+ * @param string $frameworkType
34
+ * @return string
35
+ */
36
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
37
+ {
38
+ $type = $this->package->getType();
39
+
40
+ $prettyName = $this->package->getPrettyName();
41
+ if (strpos($prettyName, '/') !== false) {
42
+ list($vendor, $name) = explode('/', $prettyName);
43
+ } else {
44
+ $vendor = '';
45
+ $name = $prettyName;
46
+ }
47
+
48
+ $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
49
+
50
+ $extra = $package->getExtra();
51
+ if (!empty($extra['installer-name'])) {
52
+ $availableVars['name'] = $extra['installer-name'];
53
+ }
54
+
55
+ if ($this->composer->getPackage()) {
56
+ $extra = $this->composer->getPackage()->getExtra();
57
+ if (!empty($extra['installer-paths'])) {
58
+ $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
59
+ if ($customPath !== false) {
60
+ return $this->templatePath($customPath, $availableVars);
61
+ }
62
+ }
63
+ }
64
+
65
+ $packageType = substr($type, strlen($frameworkType) + 1);
66
+ $locations = $this->getLocations();
67
+ if (!isset($locations[$packageType])) {
68
+ throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
69
+ }
70
+
71
+ return $this->templatePath($locations[$packageType], $availableVars);
72
+ }
73
+
74
+ /**
75
+ * For an installer to override to modify the vars per installer.
76
+ *
77
+ * @param array $vars
78
+ * @return array
79
+ */
80
+ public function inflectPackageVars($vars)
81
+ {
82
+ return $vars;
83
+ }
84
+
85
+ /**
86
+ * Gets the installer's locations
87
+ *
88
+ * @return array
89
+ */
90
+ public function getLocations()
91
+ {
92
+ return $this->locations;
93
+ }
94
+
95
+ /**
96
+ * Replace vars in a path
97
+ *
98
+ * @param string $path
99
+ * @param array $vars
100
+ * @return string
101
+ */
102
+ protected function templatePath($path, array $vars = array())
103
+ {
104
+ if (strpos($path, '{') !== false) {
105
+ extract($vars);
106
+ preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
107
+ if (!empty($matches[1])) {
108
+ foreach ($matches[1] as $var) {
109
+ $path = str_replace('{$' . $var . '}', $$var, $path);
110
+ }
111
+ }
112
+ }
113
+
114
+ return $path;
115
+ }
116
+
117
+ /**
118
+ * Search through a passed paths array for a custom install path.
119
+ *
120
+ * @param array $paths
121
+ * @param string $name
122
+ * @param string $type
123
+ * @param string $vendor = NULL
124
+ * @return string
125
+ */
126
+ protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
127
+ {
128
+ foreach ($paths as $path => $names) {
129
+ if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
130
+ return $path;
131
+ }
132
+ }
133
+
134
+ return false;
135
+ }
136
+ }
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ use Composer\Util\Filesystem;
6
+
7
+ /**
8
+ * Installer for Bitrix Framework. Supported types of extensions:
9
+ * - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
10
+ * - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
11
+ * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
12
+ *
13
+ * You can set custom path to directory with Bitrix kernel in `composer.json`:
14
+ *
15
+ * ```json
16
+ * {
17
+ * "extra": {
18
+ * "bitrix-dir": "s1/bitrix"
19
+ * }
20
+ * }
21
+ * ```
22
+ *
23
+ * @author Nik Samokhvalov <nik@samokhvalov.info>
24
+ * @author Denis Kulichkin <onexhovia@gmail.com>
25
+ */
26
+ class BitrixInstaller extends BaseInstaller
27
+ {
28
+ protected $locations = array(
29
+ 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
30
+ 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
31
+ 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
32
+ 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
33
+ 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
34
+ 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
35
+ );
36
+
37
+ /**
38
+ * @var array Storage for informations about duplicates at all the time of installation packages.
39
+ */
40
+ private static $checkedDuplicates = array();
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ public function inflectPackageVars($vars)
46
+ {
47
+ if ($this->composer->getPackage()) {
48
+ $extra = $this->composer->getPackage()->getExtra();
49
+
50
+ if (isset($extra['bitrix-dir'])) {
51
+ $vars['bitrix_dir'] = $extra['bitrix-dir'];
52
+ }
53
+ }
54
+
55
+ if (!isset($vars['bitrix_dir'])) {
56
+ $vars['bitrix_dir'] = 'bitrix';
57
+ }
58
+
59
+ return parent::inflectPackageVars($vars);
60
+ }
61
+
62
+ /**
63
+ * {@inheritdoc}
64
+ */
65
+ protected function templatePath($path, array $vars = array())
66
+ {
67
+ $templatePath = parent::templatePath($path, $vars);
68
+ $this->checkDuplicates($templatePath, $vars);
69
+
70
+ return $templatePath;
71
+ }
72
+
73
+ /**
74
+ * Duplicates search packages.
75
+ *
76
+ * @param string $path
77
+ * @param array $vars
78
+ */
79
+ protected function checkDuplicates($path, array $vars = array())
80
+ {
81
+ $packageType = substr($vars['type'], strlen('bitrix') + 1);
82
+ $localDir = explode('/', $vars['bitrix_dir']);
83
+ array_pop($localDir);
84
+ $localDir[] = 'local';
85
+ $localDir = implode('/', $localDir);
86
+
87
+ $oldPath = str_replace(
88
+ array('{$bitrix_dir}', '{$name}'),
89
+ array($localDir, $vars['name']),
90
+ $this->locations[$packageType]
91
+ );
92
+
93
+ if (in_array($oldPath, static::$checkedDuplicates)) {
94
+ return;
95
+ }
96
+
97
+ if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
98
+
99
+ $this->io->writeError(' <error>Duplication of packages:</error>');
100
+ $this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
101
+
102
+ while (true) {
103
+ switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
104
+ case 'y':
105
+ $fs = new Filesystem();
106
+ $fs->removeDirectory($oldPath);
107
+ break 2;
108
+
109
+ case 'n':
110
+ break 2;
111
+
112
+ case '?':
113
+ default:
114
+ $this->io->writeError(array(
115
+ ' y - delete package ' . $oldPath . ' and to continue with the installation',
116
+ ' n - don\'t delete and to continue with the installation',
117
+ ));
118
+ $this->io->writeError(' ? - print help');
119
+ break;
120
+ }
121
+ }
122
+ }
123
+
124
+ static::$checkedDuplicates[] = $oldPath;
125
+ }
126
+ }
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class BonefishInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'Packages/{$vendor}/{$name}/'
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\DependencyResolver\Pool;
5
+
6
+ class CakePHPInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'plugin' => 'Plugin/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name to CamelCase
14
+ */
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
18
+ return $vars;
19
+ }
20
+
21
+ $nameParts = explode('/', $vars['name']);
22
+ foreach ($nameParts as &$value) {
23
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
24
+ $value = str_replace(array('-', '_'), ' ', $value);
25
+ $value = str_replace(' ', '', ucwords($value));
26
+ }
27
+ $vars['name'] = implode('/', $nameParts);
28
+
29
+ return $vars;
30
+ }
31
+
32
+ /**
33
+ * Change the default plugin location when cakephp >= 3.0
34
+ */
35
+ public function getLocations()
36
+ {
37
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
38
+ $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
39
+ }
40
+ return $this->locations;
41
+ }
42
+
43
+ /**
44
+ * Check if CakePHP version matches against a version
45
+ *
46
+ * @param string $matcher
47
+ * @param string $version
48
+ * @return bool
49
+ */
50
+ protected function matchesCakeVersion($matcher, $version)
51
+ {
52
+ if (class_exists('Composer\Semver\Constraint\MultiConstraint')) {
53
+ $multiClass = 'Composer\Semver\Constraint\MultiConstraint';
54
+ $constraintClass = 'Composer\Semver\Constraint\Constraint';
55
+ } else {
56
+ $multiClass = 'Composer\Package\LinkConstraint\MultiConstraint';
57
+ $constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint';
58
+ }
59
+
60
+ $repositoryManager = $this->composer->getRepositoryManager();
61
+ if ($repositoryManager) {
62
+ $repos = $repositoryManager->getLocalRepository();
63
+ if (!$repos) {
64
+ return false;
65
+ }
66
+ $cake3 = new $multiClass(array(
67
+ new $constraintClass($matcher, $version),
68
+ new $constraintClass('!=', '9999999-dev'),
69
+ ));
70
+ $pool = new Pool('dev');
71
+ $pool->addRepository($repos);
72
+ $packages = $pool->whatProvides('cakephp/cakephp');
73
+ foreach ($packages as $package) {
74
+ $installed = new $constraintClass('=', $package->getVersion());
75
+ if ($cake3->matches($installed)) {
76
+ return true;
77
+ }
78
+ }
79
+ }
80
+ return false;
81
+ }
82
+ }
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ChefInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'cookbook' => 'Chef/{$vendor}/{$name}/',
8
+ 'role' => 'Chef/roles/{$name}/',
9
+ );
10
+ }
11
+
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ClanCatsFrameworkInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ship' => 'CCF/orbit/{$name}/',
8
+ 'theme' => 'CCF/app/themes/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CockpitInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'cockpit/modules/addons/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format module name.
12
+ *
13
+ * Strip `module-` prefix from package name.
14
+ *
15
+ * @param array @vars
16
+ *
17
+ * @return array
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] == 'cockpit-module') {
22
+ return $this->inflectModuleVars($vars);
23
+ }
24
+
25
+ return $vars;
26
+ }
27
+
28
+ public function inflectModuleVars($vars)
29
+ {
30
+ $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
31
+
32
+ return $vars;
33
+ }
34
+ }
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CodeIgniterInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'application/libraries/{$name}/',
8
+ 'third-party' => 'application/third_party/{$name}/',
9
+ 'module' => 'application/modules/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class Concrete5Installer extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'concrete/',
8
+ 'block' => 'application/blocks/{$name}/',
9
+ 'package' => 'packages/{$name}/',
10
+ 'theme' => 'application/themes/{$name}/',
11
+ 'update' => 'updates/{$name}/',
12
+ );
13
+ }
vendor/composer/installers/src/Composer/Installers/CraftInstaller.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Installer for Craft Plugins
6
+ */
7
+ class CraftInstaller extends BaseInstaller
8
+ {
9
+ const NAME_PREFIX = 'craft';
10
+ const NAME_SUFFIX = 'plugin';
11
+
12
+ protected $locations = array(
13
+ 'plugin' => 'craft/plugins/{$name}/',
14
+ );
15
+
16
+ /**
17
+ * Strip `craft-` prefix and/or `-plugin` suffix from package names
18
+ *
19
+ * @param array $vars
20
+ *
21
+ * @return array
22
+ */
23
+ final public function inflectPackageVars($vars)
24
+ {
25
+ return $this->inflectPluginVars($vars);
26
+ }
27
+
28
+ private function inflectPluginVars($vars)
29
+ {
30
+ $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
31
+ $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);
32
+
33
+ return $vars;
34
+ }
35
+ }
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CroogoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'Plugin/{$name}/',
8
+ 'theme' => 'View/Themed/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DecibelInstaller extends BaseInstaller
5
+ {
6
+ /** @var array */
7
+ protected $locations = array(
8
+ 'app' => 'app/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/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,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DrupalInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'core/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'theme' => 'themes/{$name}/',
10
+ 'library' => 'libraries/{$name}/',
11
+ 'profile' => 'profiles/{$name}/',
12
+ 'drush' => 'drush/{$name}/',
13
+ 'custom-theme' => 'themes/custom/{$name}/',
14
+ 'custom-module' => 'modules/custom/{$name}',
15
+ );
16
+ }
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ElggInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'mod/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class EliasisInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'plugin' => 'plugins/{$name}/',
10
+ 'template' => 'templates/{$name}/',
11
+ );
12
+ }
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class ExpressionEngineInstaller extends BaseInstaller
7
+ {
8
+
9
+ protected $locations = array();
10
+
11
+ private $ee2Locations = array(
12
+ 'addon' => 'system/expressionengine/third_party/{$name}/',
13
+ 'theme' => 'themes/third_party/{$name}/',
14
+ );
15
+
16
+ private $ee3Locations = array(
17
+ 'addon' => 'system/user/addons/{$name}/',
18
+ 'theme' => 'themes/user/{$name}/',
19
+ );
20
+
21
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
22
+ {
23
+
24
+ $version = "{$frameworkType}Locations";
25
+ $this->locations = $this->$version;
26
+
27
+ return parent::getInstallPath($package, $frameworkType);
28
+ }
29
+ }
vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class EzPlatformInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'meta-assets' => 'web/assets/ezplatform/',
8
+ 'assets' => 'web/assets/ezplatform/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'fuel/app/modules/{$name}/',
8
+ 'package' => 'fuel/packages/{$name}/',
9
+ 'theme' => 'fuel/app/themes/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelphpInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/GravInstaller.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/ImageCMSInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ImageCMSInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'template' => 'templates/{$name}/',
8
+ 'module' => 'application/modules/{$name}/',
9
+ 'library' => 'application/libraries/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/Installer.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\IO\IOInterface;
5
+ use Composer\Installer\LibraryInstaller;
6
+ use Composer\Package\PackageInterface;
7
+ use Composer\Repository\InstalledRepositoryInterface;
8
+
9
+ class Installer extends LibraryInstaller
10
+ {
11
+ /**
12
+ * Package types to installer class map
13
+ *
14
+ * @var array
15
+ */
16
+ private $supportedTypes = array(
17
+ 'aimeos' => 'AimeosInstaller',
18
+ 'asgard' => 'AsgardInstaller',
19
+ 'attogram' => 'AttogramInstaller',
20
+ 'agl' => 'AglInstaller',
21
+ 'annotatecms' => 'AnnotateCmsInstaller',
22
+ 'bitrix' => 'BitrixInstaller',
23
+ 'bonefish' => 'BonefishInstaller',
24
+ 'cakephp' => 'CakePHPInstaller',
25
+ 'chef' => 'ChefInstaller',
26
+ 'ccframework' => 'ClanCatsFrameworkInstaller',
27
+ 'cockpit' => 'CockpitInstaller',
28
+ 'codeigniter' => 'CodeIgniterInstaller',
29
+ 'concrete5' => 'Concrete5Installer',
30
+ 'craft' => 'CraftInstaller',
31
+ 'croogo' => 'CroogoInstaller',
32
+ 'dokuwiki' => 'DokuWikiInstaller',
33
+ 'dolibarr' => 'DolibarrInstaller',
34
+ 'decibel' => 'DecibelInstaller',
35
+ 'drupal' => 'DrupalInstaller',
36
+ 'elgg' => 'ElggInstaller',
37
+ 'eliasis' => 'EliasisInstaller',
38
+ 'ee3' => 'ExpressionEngineInstaller',
39
+ 'ee2' => 'ExpressionEngineInstaller',
40
+ 'ezplatform' => 'EzPlatformInstaller',
41
+ 'fuel' => 'FuelInstaller',
42
+ 'fuelphp' => 'FuelphpInstaller',
43
+ 'grav' => 'GravInstaller',
44
+ 'hurad' => 'HuradInstaller',
45
+ 'imagecms' => 'ImageCMSInstaller',
46
+ 'itop' => 'ItopInstaller',
47
+ 'joomla' => 'JoomlaInstaller',
48
+ 'kanboard' => 'KanboardInstaller',
49
+ 'kirby' => 'KirbyInstaller',
50
+ 'kodicms' => 'KodiCMSInstaller',
51
+ 'kohana' => 'KohanaInstaller',
52
+ 'lms' => 'LanManagementSystemInstaller',
53
+ 'laravel' => 'LaravelInstaller',
54
+ 'lavalite' => 'LavaLiteInstaller',
55
+ 'lithium' => 'LithiumInstaller',
56
+ 'magento' => 'MagentoInstaller',
57
+ 'majima' => 'MajimaInstaller',
58
+ 'mako' => 'MakoInstaller',
59
+ 'maya' => 'MayaInstaller',
60
+ 'mautic' => 'MauticInstaller',
61
+ 'mediawiki' => 'MediaWikiInstaller',
62
+ 'microweber' => 'MicroweberInstaller',
63
+ 'modulework' => 'MODULEWorkInstaller',
64
+ 'modx' => 'ModxInstaller',
65
+ 'modxevo' => 'MODXEvoInstaller',
66
+ 'moodle' => 'MoodleInstaller',
67
+ 'october' => 'OctoberInstaller',
68
+ 'ontowiki' => 'OntoWikiInstaller',
69
+ 'oxid' => 'OxidInstaller',
70
+ 'osclass' => 'OsclassInstaller',
71
+ 'pxcms' => 'PxcmsInstaller',
72
+ 'phpbb' => 'PhpBBInstaller',
73
+ 'pimcore' => 'PimcoreInstaller',
74
+ 'piwik' => 'PiwikInstaller',
75
+ 'plentymarkets'=> 'PlentymarketsInstaller',
76
+ 'ppi' => 'PPIInstaller',
77
+ 'puppet' => 'PuppetInstaller',
78
+ 'radphp' => 'RadPHPInstaller',
79
+ 'phifty' => 'PhiftyInstaller',
80
+ 'porto' => 'PortoInstaller',
81
+ 'redaxo' => 'RedaxoInstaller',
82
+ 'reindex' => 'ReIndexInstaller',
83
+ 'roundcube' => 'RoundcubeInstaller',
84
+ 'shopware' => 'ShopwareInstaller',
85
+ 'sitedirect' => 'SiteDirectInstaller',
86
+ 'silverstripe' => 'SilverStripeInstaller',
87
+ 'smf' => 'SMFInstaller',
88
+ 'sydes' => 'SyDESInstaller',
89
+ 'symfony1' => 'Symfony1Installer',
90
+ 'thelia' => 'TheliaInstaller',
91
+ 'tusk' => 'TuskInstaller',
92
+ 'typo3-cms' => 'TYPO3CmsInstaller',
93
+ 'typo3-flow' => 'TYPO3FlowInstaller',
94
+ 'userfrosting' => 'UserFrostingInstaller',
95
+ 'vanilla' => 'VanillaInstaller',
96
+ 'whmcs' => 'WHMCSInstaller',
97
+ 'wolfcms' => 'WolfCMSInstaller',
98
+ 'wordpress' => 'WordPressInstaller',
99
+ 'yawik' => 'YawikInstaller',
100
+ 'zend' => 'ZendInstaller',
101
+ 'zikula' => 'ZikulaInstaller',
102
+ 'prestashop' => 'PrestashopInstaller'
103
+ );
104
+
105
+ /**
106
+ * {@inheritDoc}
107
+ */
108
+ public function getInstallPath(PackageInterface $package)
109
+ {
110
+ $type = $package->getType();
111
+ $frameworkType = $this->findFrameworkType($type);
112
+
113
+ if ($frameworkType === false) {
114
+ throw new \InvalidArgumentException(
115
+ 'Sorry the package type of this package is not yet supported.'
116
+ );
117
+ }
118
+
119
+ $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
120
+ $installer = new $class($package, $this->composer, $this->getIO());
121
+
122
+ return $installer->getInstallPath($package, $frameworkType);
123
+ }
124
+
125
+ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
126
+ {
127
+ parent::uninstall($repo, $package);
128
+ $installPath = $this->getPackageBasePath($package);
129
+ $this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
130
+ }
131
+
132
+ /**
133
+ * {@inheritDoc}
134
+ */
135
+ public function supports($packageType)
136
+ {
137
+ $frameworkType = $this->findFrameworkType($packageType);
138
+
139
+ if ($frameworkType === false) {
140
+ return false;
141
+ }
142
+
143
+ $locationPattern = $this->getLocationPattern($frameworkType);
144
+
145
+ return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
146
+ }
147
+
148
+ /**
149
+ * Finds a supported framework type if it exists and returns it
150
+ *
151
+ * @param string $type
152
+ * @return string
153
+ */
154
+ protected function findFrameworkType($type)
155
+ {
156
+ $frameworkType = false;
157
+
158
+ krsort($this->supportedTypes);
159
+
160
+ foreach ($this->supportedTypes as $key => $val) {
161
+ if ($key === substr($type, 0, strlen($key))) {
162
+ $frameworkType = substr($type, 0, strlen($key));
163
+ break;
164
+ }
165
+ }
166
+
167
+ return $frameworkType;
168
+ }
169
+
170
+ /**
171
+ * Get the second part of the regular expression to check for support of a
172
+ * package type
173
+ *
174
+ * @param string $frameworkType
175
+ * @return string
176
+ */
177
+ protected function getLocationPattern($frameworkType)
178
+ {
179
+ $pattern = false;
180
+ if (!empty($this->supportedTypes[$frameworkType])) {
181
+ $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
182
+ /** @var BaseInstaller $framework */
183
+ $framework = new $frameworkClass(null, $this->composer, $this->getIO());
184
+ $locations = array_keys($framework->getLocations());
185
+ $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
186
+ }
187
+
188
+ return $pattern ? : '(\w+)';
189
+ }
190
+
191
+ /**
192
+ * Get I/O object
193
+ *
194
+ * @return IOInterface
195
+ */
196
+ private function getIO()
197
+ {
198
+ return $this->io;
199
+ }
200
+ }
vendor/composer/installers/src/Composer/Installers/ItopInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ItopInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'extensions/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php 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/KanboardInstaller.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ *
6
+ * Installer for kanboard plugins
7
+ *
8
+ * kanboard.net
9
+ *
10
+ * Class KanboardInstaller
11
+ * @package Composer\Installers
12
+ */
13
+ class KanboardInstaller extends BaseInstaller
14
+ {
15
+ protected $locations = array(
16
+ 'plugin' => 'plugins/{$name}/',
17
+ );
18
+ }
vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KirbyInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'site/plugins/{$name}/',
8
+ 'field' => 'site/fields/{$name}/',
9
+ 'tag' => 'site/tags/{$name}/'
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KodiCMSInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'cms/plugins/{$name}/',
8
+ 'media' => 'cms/media/vendor/{$name}/'
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php 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/LanManagementSystemInstaller.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class LanManagementSystemInstaller extends BaseInstaller
6
+ {
7
+
8
+ protected $locations = array(
9
+ 'plugin' => 'plugins/{$name}/',
10
+ 'template' => 'templates/{$name}/',
11
+ 'document-template' => 'documents/templates/{$name}/',
12
+ 'userpanel-module' => 'userpanel/modules/{$name}/',
13
+ );
14
+
15
+ /**
16
+ * Format package name to CamelCase
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
21
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
22
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
23
+
24
+ return $vars;
25
+ }
26
+
27
+ }
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php 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/LavaLiteInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class LavaLiteInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'packages/{$vendor}/{$name}/',
8
+ 'theme' => 'public/themes/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php 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/MajimaInstaller.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Plugin/theme installer for majima
6
+ * @author David Neustadt
7
+ */
8
+ class MajimaInstaller extends BaseInstaller
9
+ {
10
+ protected $locations = array(
11
+ 'plugin' => 'plugins/{$name}/',
12
+ );
13
+
14
+ /**
15
+ * Transforms the names
16
+ * @param array $vars
17
+ * @return array
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ return $this->correctPluginName($vars);
22
+ }
23
+
24
+ /**
25
+ * Change hyphenated names to camelcase
26
+ * @param array $vars
27
+ * @return array
28
+ */
29
+ private function correctPluginName($vars)
30
+ {
31
+ $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
32
+ return strtoupper($matches[0][1]);
33
+ }, $vars['name']);
34
+ $vars['name'] = ucfirst($camelCasedName);
35
+ return $vars;
36
+ }
37
+ }
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php 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/MauticInstaller.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MauticInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'plugins/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name of mautic-plugins to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ if ($vars['type'] == 'mautic-plugin') {
17
+ $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
18
+ return strtoupper($matches[0][1]);
19
+ }, ucfirst($vars['name']));
20
+ }
21
+
22
+ return $vars;
23
+ }
24
+
25
+ }
vendor/composer/installers/src/Composer/Installers/MayaInstaller.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MayaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name.
12
+ *
13
+ * For package type maya-module, cut off a trailing '-module' if present.
14
+ *
15
+ */
16
+ public function inflectPackageVars($vars)
17
+ {
18
+ if ($vars['type'] === 'maya-module') {
19
+ return $this->inflectModuleVars($vars);
20
+ }
21
+
22
+ return $vars;
23
+ }
24
+
25
+ protected function inflectModuleVars($vars)
26
+ {
27
+ $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
28
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
29
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
30
+
31
+ return $vars;
32
+ }
33
+ }
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php 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/ModxInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * An installer to handle MODX specifics when installing packages.
6
+ */
7
+ class ModxInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'extra' => 'core/packages/{$name}/'
11
+ );
12
+ }
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MoodleInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'mod' => 'mod/{$name}/',
8
+ 'admin_report' => 'admin/report/{$name}/',
9
+ 'atto' => 'lib/editor/atto/plugins/{$name}/',
10
+ 'tool' => 'admin/tool/{$name}/',
11
+ 'assignment' => 'mod/assignment/type/{$name}/',
12
+ 'assignsubmission' => 'mod/assign/submission/{$name}/',
13
+ 'assignfeedback' => 'mod/assign/feedback/{$name}/',
14
+ 'auth' => 'auth/{$name}/',
15
+ 'availability' => 'availability/condition/{$name}/',
16
+ 'block' => 'blocks/{$name}/',
17
+ 'booktool' => 'mod/book/tool/{$name}/',
18
+ 'cachestore' => 'cache/stores/{$name}/',
19
+ 'cachelock' => 'cache/locks/{$name}/',
20
+ 'calendartype' => 'calendar/type/{$name}/',
21
+ 'format' => 'course/format/{$name}/',
22
+ 'coursereport' => 'course/report/{$name}/',
23
+ 'datafield' => 'mod/data/field/{$name}/',
24
+ 'datapreset' => 'mod/data/preset/{$name}/',
25
+ 'editor' => 'lib/editor/{$name}/',
26
+ 'enrol' => 'enrol/{$name}/',
27
+ 'filter' => 'filter/{$name}/',
28
+ 'gradeexport' => 'grade/export/{$name}/',
29
+ 'gradeimport' => 'grade/import/{$name}/',
30
+ 'gradereport' => 'grade/report/{$name}/',
31
+ 'gradingform' => 'grade/grading/form/{$name}/',
32
+ 'local' => 'local/{$name}/',
33
+ 'logstore' => 'admin/tool/log/store/{$name}/',
34
+ 'ltisource' => 'mod/lti/source/{$name}/',
35
+ 'ltiservice' => 'mod/lti/service/{$name}/',
36
+ 'message' => 'message/output/{$name}/',
37
+ 'mnetservice' => 'mnet/service/{$name}/',
38
+ 'plagiarism' => 'plagiarism/{$name}/',
39
+ 'portfolio' => 'portfolio/{$name}/',
40
+ 'qbehaviour' => 'question/behaviour/{$name}/',
41
+ 'qformat' => 'question/format/{$name}/',
42
+ 'qtype' => 'question/type/{$name}/',
43
+ 'quizaccess' => 'mod/quiz/accessrule/{$name}/',
44
+ 'quiz' => 'mod/quiz/report/{$name}/',
45
+ 'report' => 'report/{$name}/',
46
+ 'repository' => 'repository/{$name}/',
47
+ 'scormreport' => 'mod/scorm/report/{$name}/',
48
+ 'search' => 'search/engine/{$name}/',
49
+ 'theme' => 'theme/{$name}/',
50
+ 'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
51
+ 'profilefield' => 'user/profile/field/{$name}/',
52
+ 'webservice' => 'webservice/{$name}/',
53
+ 'workshopallocation' => 'mod/workshop/allocation/{$name}/',
54
+ 'workshopeval' => 'mod/workshop/eval/{$name}/',
55
+ 'workshopform' => 'mod/workshop/form/{$name}/'
56
+ );
57
+ }
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php 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('/^oc-|-plugin$/', '', $vars['name']);
36
+
37
+ return $vars;
38
+ }
39
+
40
+ protected function inflectThemeVars($vars)
41
+ {
42
+ $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
43
+
44
+ return $vars;
45
+ }
46
+ }
vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class OntoWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'extensions/{$name}/',
8
+ 'theme' => 'extensions/themes/{$name}/',
9
+ 'translation' => 'extensions/translations/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name to lower case and remove ".ontowiki" suffix
14
+ */
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ $vars['name'] = strtolower($vars['name']);
18
+ $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
19
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
20
+ $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);
21
+
22
+ return $vars;
23
+ }
24
+ }
vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+
5
+ class OsclassInstaller extends BaseInstaller
6
+ {
7
+
8
+ protected $locations = array(
9
+ 'plugin' => 'oc-content/plugins/{$name}/',
10
+ 'theme' => 'oc-content/themes/{$name}/',
11
+ 'language' => 'oc-content/languages/{$name}/',
12
+ );
13
+
14
+ }
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class OxidInstaller extends BaseInstaller
7
+ {
8
+ const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
9
+
10
+ protected $locations = array(
11
+ 'module' => 'modules/{$name}/',
12
+ 'theme' => 'application/views/{$name}/',
13
+ 'out' => 'out/{$name}/',
14
+ );
15
+
16
+ /**
17
+ * getInstallPath
18
+ *
19
+ * @param PackageInterface $package
20
+ * @param string $frameworkType
21
+ * @return void
22
+ */
23
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
+ {
25
+ $installPath = parent::getInstallPath($package, $frameworkType);
26
+ $type = $this->package->getType();
27
+ if ($type === 'oxid-module') {
28
+ $this->prepareVendorDirectory($installPath);
29
+ }
30
+ return $installPath;
31
+ }
32
+
33
+ /**
34
+ * prepareVendorDirectory
35
+ *
36
+ * Makes sure there is a vendormetadata.php file inside
37
+ * the vendor folder if there is a vendor folder.
38
+ *
39
+ * @param string $installPath
40
+ * @return void
41
+ */
42
+ protected function prepareVendorDirectory($installPath)
43
+ {
44
+ $matches = '';
45
+ $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
46
+ if (!$hasVendorDirectory) {
47
+ return;
48
+ }
49
+
50
+ $vendorDirectory = $matches['vendor'];
51
+ $vendorPath = getcwd() . '/modules/' . $vendorDirectory;
52
+ if (!file_exists($vendorPath)) {
53
+ mkdir($vendorPath, 0755, true);
54
+ }
55
+
56
+ $vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
57
+ touch($vendorMetaDataPath);
58
+ }
59
+ }
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php 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/PhiftyInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PhiftyInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'bundle' => 'bundles/{$name}/',
8
+ 'library' => 'libraries/{$name}/',
9
+ 'framework' => 'frameworks/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php 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/PlentymarketsInstaller.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PlentymarketsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => '{$name}/'
8
+ );
9
+
10
+ /**
11
+ * Remove hyphen, "plugin" and format to camelcase
12
+ * @param array $vars
13
+ *
14
+ * @return array
15
+ */
16
+ public function inflectPackageVars($vars)
17
+ {
18
+ $vars['name'] = explode("-", $vars['name']);
19
+ foreach ($vars['name'] as $key => $name) {
20
+ $vars['name'][$key] = ucfirst($vars['name'][$key]);
21
+ if (strcasecmp($name, "Plugin") == 0) {
22
+ unset($vars['name'][$key]);
23
+ }
24
+ }
25
+ $vars['name'] = implode("",$vars['name']);
26
+
27
+ return $vars;
28
+ }
29
+ }
vendor/composer/installers/src/Composer/Installers/Plugin.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ use Composer\Composer;
6
+ use Composer\IO\IOInterface;
7
+ use Composer\Plugin\PluginInterface;
8
+
9
+ class Plugin implements PluginInterface
10
+ {
11
+
12
+ public function activate(Composer $composer, IOInterface $io)
13
+ {
14
+ $installer = new Installer($io, $composer);
15
+ $composer->getInstallationManager()->addInstaller($installer);
16
+ }
17
+ }
vendor/composer/installers/src/Composer/Installers/PortoInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PortoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'container' => 'app/Containers/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PrestashopInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php 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/PxcmsInstaller.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PxcmsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'app/Modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * @param array $vars
15
+ *
16
+ * @return array
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ if ($vars['type'] === 'pxcms-module') {
21
+ return $this->inflectModuleVars($vars);
22
+ }
23
+
24
+ if ($vars['type'] === 'pxcms-theme') {
25
+ return $this->inflectThemeVars($vars);
26
+ }
27
+
28
+ return $vars;
29
+ }
30
+
31
+ /**
32
+ * For package type pxcms-module, cut off a trailing '-plugin' if present.
33
+ *
34
+ * return string
35
+ */
36
+ protected function inflectModuleVars($vars)
37
+ {
38
+ $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
39
+ $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
40
+ $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
41
+ $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
42
+ $vars['name'] = ucwords($vars['name']); // make module name camelcased
43
+
44
+ return $vars;
45
+ }
46
+
47
+
48
+ /**
49
+ * For package type pxcms-module, cut off a trailing '-plugin' if present.
50
+ *
51
+ * return string
52
+ */
53
+ protected function inflectThemeVars($vars)
54
+ {
55
+ $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
56
+ $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
57
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
58
+ $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
59
+ $vars['name'] = ucwords($vars['name']); // make module name camelcased
60
+
61
+ return $vars;
62
+ }
63
+ }
vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class RadPHPInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'bundle' => 'src/{$name}/'
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $nameParts = explode('/', $vars['name']);
16
+ foreach ($nameParts as &$value) {
17
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
18
+ $value = str_replace(array('-', '_'), ' ', $value);
19
+ $value = str_replace(' ', '', ucwords($value));
20
+ }
21
+ $vars['name'] = implode('/', $nameParts);
22
+ return $vars;
23
+ }
24
+ }
vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ReIndexInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'theme' => 'themes/{$name}/',
8
+ 'plugin' => 'plugins/{$name}/'
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php 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,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Plugin/theme installer for shopware
6
+ * @author Benjamin Boit
7
+ */
8
+ class ShopwareInstaller extends BaseInstaller
9
+ {
10
+ protected $locations = array(
11
+ 'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
12
+ 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
13
+ 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
14
+ 'theme' => 'templates/{$name}/',
15
+ 'plugin' => 'custom/plugins/{$name}/',
16
+ 'frontend-theme' => 'themes/Frontend/{$name}/',
17
+ );
18
+
19
+ /**
20
+ * Transforms the names
21
+ * @param array $vars
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ if ($vars['type'] === 'shopware-theme') {
27
+ return $this->correctThemeName($vars);
28
+ }
29
+
30
+ return $this->correctPluginName($vars);
31
+ }
32
+
33
+ /**
34
+ * Changes the name to a camelcased combination of vendor and name
35
+ * @param array $vars
36
+ * @return array
37
+ */
38
+ private function correctPluginName($vars)
39
+ {
40
+ $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
41
+ return strtoupper($matches[0][1]);
42
+ }, $vars['name']);
43
+
44
+ $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
45
+
46
+ return $vars;
47
+ }
48
+
49
+ /**
50
+ * Changes the name to a underscore separated name
51
+ * @param array $vars
52
+ * @return array
53
+ */
54
+ private function correctThemeName($vars)
55
+ {
56
+ $vars['name'] = str_replace('-', '_', $vars['name']);
57
+
58
+ return $vars;
59
+ }
60
+ }
vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class SilverStripeInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'module' => '{$name}/',
10
+ 'theme' => 'themes/{$name}/',
11
+ );
12
+
13
+ /**
14
+ * Return the install path based on package type.
15
+ *
16
+ * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
17
+ * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
18
+ *
19
+ * @param PackageInterface $package
20
+ * @param string $frameworkType
21
+ * @return string
22
+ */
23
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
+ {
25
+ if (
26
+ $package->getName() == 'silverstripe/framework'
27
+ && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
28
+ && version_compare($package->getVersion(), '2.999.999') < 0
29
+ ) {
30
+ return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
31
+ }
32
+
33
+ return parent::getInstallPath($package, $frameworkType);
34
+ }
35
+ }
vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class SiteDirectInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'module' => 'modules/{$vendor}/{$name}/',
9
+ 'plugin' => 'plugins/{$vendor}/{$name}/'
10
+ );
11
+
12
+ public function inflectPackageVars($vars)
13
+ {
14
+ return $this->parseVars($vars);
15
+ }
16
+
17
+ protected function parseVars($vars)
18
+ {
19
+ $vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
20
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
21
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
22
+
23
+ return $vars;
24
+ }
25
+ }
vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class SyDESInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'app/modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format module name.
13
+ *
14
+ * Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
15
+ *
16
+ * @param array @vars
17
+ *
18
+ * @return array
19
+ */
20
+ public function inflectPackageVars($vars)
21
+ {
22
+ if ($vars['type'] == 'sydes-module') {
23
+ return $this->inflectModuleVars($vars);
24
+ }
25
+
26
+ if ($vars['type'] === 'sydes-theme') {
27
+ return $this->inflectThemeVars($vars);
28
+ }
29
+
30
+ return $vars;
31
+ }
32
+
33
+ public function inflectModuleVars($vars)
34
+ {
35
+ $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
36
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
37
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
38
+
39
+ return $vars;
40
+ }
41
+
42
+ protected function inflectThemeVars($vars)
43
+ {
44
+ $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
45
+ $vars['name'] = strtolower($vars['name']);
46
+
47
+ return $vars;
48
+ }
49
+ }
vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php 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,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Extension installer for TYPO3 CMS
6
+ *
7
+ * @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
8
+ *
9
+ * @author Sascha Egerer <sascha.egerer@dkd.de>
10
+ */
11
+ class TYPO3CmsInstaller extends BaseInstaller
12
+ {
13
+ protected $locations = array(
14
+ 'extension' => 'typo3conf/ext/{$name}/',
15
+ );
16
+ }
vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php 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/UserFrostingInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class UserFrostingInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'sprinkle' => 'app/sprinkles/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class VanillaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'plugins/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class VgmcpInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'bundle' => 'src/{$vendor}/{$name}/',
8
+ 'theme' => 'themes/{$name}/'
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
15
+ *
16
+ * For package type vgmcp-theme, cut off a trailing '-theme' if present.
17
+ *
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] === 'vgmcp-bundle') {
22
+ return $this->inflectPluginVars($vars);
23
+ }
24
+
25
+ if ($vars['type'] === 'vgmcp-theme') {
26
+ return $this->inflectThemeVars($vars);
27
+ }
28
+
29
+ return $vars;
30
+ }
31
+
32
+ protected function inflectPluginVars($vars)
33
+ {
34
+ $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
35
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
+
38
+ return $vars;
39
+ }
40
+
41
+ protected function inflectThemeVars($vars)
42
+ {
43
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
+
47
+ return $vars;
48
+ }
49
+ }
vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php 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,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class WordPressInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'wp-content/plugins/{$name}/',
8
+ 'theme' => 'wp-content/themes/{$name}/',
9
+ 'muplugin' => 'wp-content/mu-plugins/{$name}/',
10
+ 'dropin' => 'wp-content/{$name}/',
11
+ );
12
+ }
vendor/composer/installers/src/Composer/Installers/YawikInstaller.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: cbleek
5
+ * Date: 25.03.16
6
+ * Time: 20:55
7
+ */
8
+
9
+ namespace Composer\Installers;
10
+
11
+
12
+ class YawikInstaller extends BaseInstaller
13
+ {
14
+ protected $locations = array(
15
+ 'module' => 'module/{$name}/',
16
+ );
17
+
18
+ /**
19
+ * Format package name to CamelCase
20
+ * @param array $vars
21
+ *
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
+
30
+ return $vars;
31
+ }
32
+ }
vendor/composer/installers/src/Composer/Installers/ZendInstaller.php 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,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\AsgardInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase;
8
+
9
+ class AsgardInstallerTest extends TestCase
10
+ {
11
+ /**
12
+ * @var AsgardInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new AsgardInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ array('name' => $expected, 'type' => $type),
31
+ $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ // Should keep module name StudlyCase
39
+ array(
40
+ 'asgard-module',
41
+ 'user-profile',
42
+ 'UserProfile'
43
+ ),
44
+ array(
45
+ 'asgard-module',
46
+ 'asgard-module',
47
+ 'Asgard'
48
+ ),
49
+ array(
50
+ 'asgard-module',
51
+ 'blog',
52
+ 'Blog'
53
+ ),
54
+ // tests that exactly one '-module' is cut off
55
+ array(
56
+ 'asgard-module',
57
+ 'some-module-module',
58
+ 'SomeModule',
59
+ ),
60
+ // tests that exactly one '-theme' is cut off
61
+ array(
62
+ 'asgard-theme',
63
+ 'some-theme-theme',
64
+ 'SomeTheme',
65
+ ),
66
+ // tests that names without '-theme' suffix stay valid
67
+ array(
68
+ 'asgard-theme',
69
+ 'someothertheme',
70
+ 'Someothertheme',
71
+ ),
72
+ // Should keep theme name StudlyCase
73
+ array(
74
+ 'asgard-theme',
75
+ 'adminlte-advanced',
76
+ 'AdminlteAdvanced'
77
+ ),
78
+ );
79
+ }
80
+ }
vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers\Test;
4
+
5
+ use Composer\Installers\BitrixInstaller;
6
+ use Composer\Package\Package;
7
+ use Composer\Composer;
8
+
9
+ /**
10
+ * Tests for the BitrixInstaller Class
11
+ *
12
+ * @coversDefaultClass Composer\Installers\BitrixInstaller
13
+ */
14
+ class BitrixInstallerTest extends TestCase
15
+ {
16
+ /** @var BitrixInstaller */
17
+ private $installer;
18
+
19
+ /** @var Composer */
20
+ private $composer;
21
+
22
+
23
+ /**
24
+ * Sets up the fixture, for example, instantiate the class-under-test.
25
+ *
26
+ * This method is called before a test is executed.
27
+ */
28
+ final function setUp()
29
+ {
30
+ $this->composer = new Composer();
31
+ }
32
+
33
+ /**
34
+ * @param string $vars
35
+ * @param string $expectedVars
36
+ *
37
+ * @covers ::inflectPackageVars
38
+ *
39
+ * @dataProvider provideExpectedInflectionResults
40
+ */
41
+ final public function testInflectPackageVars($vars, $expectedVars)
42
+ {
43
+
44
+ $this->installer = new BitrixInstaller(
45
+ new Package($vars['name'], '4.2', '4.2'),
46
+ $this->composer
47
+ );
48
+ $actual = $this->installer->inflectPackageVars($vars);
49
+ $this->assertEquals($actual, $expectedVars);
50
+ }
51
+
52
+ /**
53
+ * Provides various parameters for packages and the expected result after inflection
54
+ *
55
+ * @return array
56
+ */
57
+ final public function provideExpectedInflectionResults()
58
+ {
59
+ return array(
60
+ //check bitrix-dir is correct
61
+ array(
62
+ array('name' => 'Nyan/Cat'),
63
+ array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
64
+ ),
65
+ array(
66
+ array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'),
67
+ array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
68
+ ),
69
+ array(
70
+ array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'),
71
+ array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local')
72
+ ),
73
+ );
74
+ }
75
+ }
vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\CakePHPInstaller;
5
+ use Composer\Repository\RepositoryManager;
6
+ use Composer\Repository\InstalledArrayRepository;
7
+ use Composer\Package\Package;
8
+ use Composer\Package\RootPackage;
9
+ use Composer\Package\Version\VersionParser;
10
+ use Composer\Composer;
11
+ use Composer\Config;
12
+
13
+ class CakePHPInstallerTest extends TestCase
14
+ {
15
+ private $composer;
16
+ private $io;
17
+
18
+ /**
19
+ * setUp
20
+ *
21
+ * @return void
22
+ */
23
+ public function setUp()
24
+ {
25
+ $this->package = new Package('CamelCased', '1.0', '1.0');
26
+ $this->io = $this->getMock('Composer\IO\PackageInterface');
27
+ $this->composer = new Composer();
28
+ $this->composer->setConfig(new Config(false));
29
+ }
30
+
31
+ /**
32
+ * testInflectPackageVars
33
+ *
34
+ * @return void
35
+ */
36
+ public function testInflectPackageVars()
37
+ {
38
+ $installer = new CakePHPInstaller($this->package, $this->composer);
39
+ $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
40
+ $this->assertEquals($result, array('name' => 'CamelCased'));
41
+
42
+ $installer = new CakePHPInstaller($this->package, $this->composer);
43
+ $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
44
+ $this->assertEquals($result, array('name' => 'WithDash'));
45
+
46
+ $installer = new CakePHPInstaller($this->package, $this->composer);
47
+ $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
48
+ $this->assertEquals($result, array('name' => 'WithUnderscore'));
49
+
50
+ $installer = new CakePHPInstaller($this->package, $this->composer);
51
+ $result = $installer->inflectPackageVars(array('name' => 'cake/acl'));
52
+ $this->assertEquals($result, array('name' => 'Cake/Acl'));
53
+
54
+ $installer = new CakePHPInstaller($this->package, $this->composer);
55
+ $result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit'));
56
+ $this->assertEquals($result, array('name' => 'Cake/DebugKit'));
57
+ }
58
+
59
+ /**
60
+ * Test getLocations returning appropriate values based on CakePHP version
61
+ *
62
+ */
63
+ public function testGetLocations() {
64
+ $package = new RootPackage('CamelCased', '1.0', '1.0');
65
+ $composer = $this->composer;
66
+ $rm = new RepositoryManager(
67
+ $this->getMock('Composer\IO\IOInterface'),
68
+ $this->getMock('Composer\Config')
69
+ );
70
+ $composer->setRepositoryManager($rm);
71
+ $installer = new CakePHPInstaller($package, $composer);
72
+
73
+ // 2.0 < cakephp < 3.0
74
+ $this->setCakephpVersion($rm, '2.0.0');
75
+ $result = $installer->getLocations();
76
+ $this->assertContains('Plugin/', $result['plugin']);
77
+
78
+ $this->setCakephpVersion($rm, '2.5.9');
79
+ $result = $installer->getLocations();
80
+ $this->assertContains('Plugin/', $result['plugin']);
81
+
82
+ $this->setCakephpVersion($rm, '~2.5');
83
+ $result = $installer->getLocations();
84
+ $this->assertContains('Plugin/', $result['plugin']);
85
+
86
+ // special handling for 2.x versions when 3.x is still in development
87
+ $this->setCakephpVersion($rm, 'dev-master');
88
+ $result = $installer->getLocations();
89
+ $this->assertContains('Plugin/', $result['plugin']);
90
+
91
+ $this->setCakephpVersion($rm, '>=2.5');
92
+ $result = $installer->getLocations();
93
+ $this->assertContains('Plugin/', $result['plugin']);
94
+
95
+ // cakephp >= 3.0
96
+ $this->setCakephpVersion($rm, '3.0.*-dev');
97
+ $result = $installer->getLocations();
98
+ $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
99
+
100
+ $this->setCakephpVersion($rm, '~8.8');
101
+ $result = $installer->getLocations();
102
+ $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
103
+ }
104
+
105
+ protected function setCakephpVersion($rm, $version) {
106
+ $parser = new VersionParser();
107
+ list(, $version) = explode(' ', $parser->parseConstraints($version));
108
+ $installed = new InstalledArrayRepository();
109
+ $package = new Package('cakephp/cakephp', $version, $version);
110
+ $installed->addPackage($package);
111
+ $rm->setLocalRepository($installed);
112
+ }
113
+
114
+ }
vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers\Test;
4
+
5
+ use Composer\Installers\CraftInstaller;
6
+
7
+ /**
8
+ * Tests for the CraftInstaller Class
9
+ *
10
+ * @coversDefaultClass Composer\Installers\CraftInstaller
11
+ */
12
+ class CraftInstallerTest extends TestCase
13
+ {
14
+ /** @var CraftInstaller */
15
+ private $installer;
16
+
17
+ /**
18
+ * Sets up the fixture, for example, instantiate the class-under-test.
19
+ *
20
+ * This method is called before a test is executed.
21
+ */
22
+ final public function setup()
23
+ {
24
+ $this->installer = new CraftInstaller();
25
+ }
26
+
27
+ /**
28
+ * @param string $packageName
29
+ * @param string $expectedName
30
+ *
31
+ * @covers ::inflectPackageVars
32
+ *
33
+ * @dataProvider provideExpectedInflectionResults
34
+ */
35
+ final public function testInflectPackageVars($packageName, $expectedName)
36
+ {
37
+ $installer = $this->installer;
38
+
39
+ $vars = array('name' => $packageName);
40
+ $expected = array('name' => $expectedName);
41
+
42
+ $actual = $installer->inflectPackageVars($vars);
43
+
44
+ $this->assertEquals($actual, $expected);
45
+ }
46
+
47
+ /**
48
+ * Provides various names for packages and the expected result after inflection
49
+ *
50
+ * @return array
51
+ */
52
+ final public function provideExpectedInflectionResults()
53
+ {
54
+ return array(
55
+ // lowercase
56
+ array('foo', 'foo'),
57
+ array('craftfoo', 'craftfoo'),
58
+ array('fooplugin', 'fooplugin'),
59
+ array('craftfooplugin', 'craftfooplugin'),
60
+ // lowercase - dash
61
+ array('craft-foo', 'foo'),
62
+ array('foo-plugin', 'foo'),
63
+ array('craft-foo-plugin', 'foo'),
64
+ // lowercase - underscore
65
+ array('craft_foo', 'craft_foo'),
66
+ array('foo_plugin', 'foo_plugin'),
67
+ array('craft_foo_plugin', 'craft_foo_plugin'),
68
+ // CamelCase
69
+ array('Foo', 'Foo'),
70
+ array('CraftFoo', 'CraftFoo'),
71
+ array('FooPlugin', 'FooPlugin'),
72
+ array('CraftFooPlugin', 'CraftFooPlugin'),
73
+ // CamelCase - Dash
74
+ array('Craft-Foo', 'Foo'),
75
+ array('Foo-Plugin', 'Foo'),
76
+ array('Craft-Foo-Plugin', 'Foo'),
77
+ // CamelCase - underscore
78
+ array('Craft_Foo', 'Craft_Foo'),
79
+ array('Foo_Plugin', 'Foo_Plugin'),
80
+ array('Craft_Foo_Plugin', 'Craft_Foo_Plugin'),
81
+ );
82
+ }
83
+ }
vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\DokuWikiInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase as BaseTestCase;
8
+
9
+ class DokuWikiInstallerTest extends BaseTestCase
10
+ {
11
+ /**
12
+ * @var DokuWikiInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new DokuWikiInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
31
+ array('name' => $expected, 'type'=>$type)
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ array(
39
+ 'dokuwiki-plugin',
40
+ 'dokuwiki-test-plugin',
41
+ 'test',
42
+ ),
43
+ array(
44
+ 'dokuwiki-plugin',
45
+ 'test-plugin',
46
+ 'test',
47
+ ),
48
+ array(
49
+ 'dokuwiki-plugin',
50
+ 'dokuwiki_test',
51
+ 'test',
52
+ ),
53
+ array(
54
+ 'dokuwiki-plugin',
55
+ 'test',
56
+ 'test',
57
+ ),
58
+ array(
59
+ 'dokuwiki-plugin',
60
+ 'test-template',
61
+ 'test-template',
62
+ ),
63
+ array(
64
+ 'dokuwiki-template',
65
+ 'dokuwiki-test-template',
66
+ 'test',
67
+ ),
68
+ array(
69
+ 'dokuwiki-template',
70
+ 'test-template',
71
+ 'test',
72
+ ),
73
+ array(
74
+ 'dokuwiki-template',
75
+ 'dokuwiki_test',
76
+ 'test',
77
+ ),
78
+ array(
79
+ 'dokuwiki-template',
80
+ 'test',
81
+ 'test',
82
+ ),
83
+ array(
84
+ 'dokuwiki-template',
85
+ 'test-plugin',
86
+ 'test-plugin',
87
+ ),
88
+ );
89
+ }
90
+ }
vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php 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,552 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\Installer;
5
+ use Composer\Util\Filesystem;
6
+ use Composer\Package\Package;
7
+ use Composer\Package\RootPackage;
8
+ use Composer\Composer;
9
+ use Composer\Config;
10
+
11
+ class InstallerTest extends TestCase
12
+ {
13
+ private $composer;
14
+ private $config;
15
+ private $vendorDir;
16
+ private $binDir;
17
+ private $dm;
18
+ private $repository;
19
+ private $io;
20
+ private $fs;
21
+
22
+ /**
23
+ * setUp
24
+ *
25
+ * @return void
26
+ */
27
+ public function setUp()
28
+ {
29
+ $this->fs = new Filesystem;
30
+
31
+ $this->composer = new Composer();
32
+ $this->config = new Config();
33
+ $this->composer->setConfig($this->config);
34
+
35
+ $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
36
+ $this->ensureDirectoryExistsAndClear($this->vendorDir);
37
+
38
+ $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
39
+ $this->ensureDirectoryExistsAndClear($this->binDir);
40
+
41
+ $this->config->merge(array(
42
+ 'config' => array(
43
+ 'vendor-dir' => $this->vendorDir,
44
+ 'bin-dir' => $this->binDir,
45
+ ),
46
+ ));
47
+
48
+ $this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
49
+ ->disableOriginalConstructor()
50
+ ->getMock();
51
+ $this->composer->setDownloadManager($this->dm);
52
+
53
+ $this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
54
+ $this->io = $this->getMock('Composer\IO\IOInterface');
55
+ }
56
+
57
+ /**
58
+ * tearDown
59
+ *
60
+ * @return void
61
+ */
62
+ public function tearDown()
63
+ {
64
+ $this->fs->removeDirectory($this->vendorDir);
65
+ $this->fs->removeDirectory($this->binDir);
66
+ }
67
+
68
+ /**
69
+ * testSupports
70
+ *
71
+ * @return void
72
+ *
73
+ * @dataProvider dataForTestSupport
74
+ */
75
+ public function testSupports($type, $expected)
76
+ {
77
+ $installer = new Installer($this->io, $this->composer);
78
+ $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
79
+ }
80
+
81
+ /**
82
+ * dataForTestSupport
83
+ */
84
+ public function dataForTestSupport()
85
+ {
86
+ return array(
87
+ array('agl-module', true),
88
+ array('aimeos-extension', true),
89
+ array('annotatecms-module', true),
90
+ array('annotatecms-component', true),
91
+ array('annotatecms-service', true),
92
+ array('attogram-module', true),
93
+ array('bitrix-module', true),
94
+ array('bitrix-component', true),
95
+ array('bitrix-theme', true),
96
+ array('bonefish-package', true),
97
+ array('cakephp', false),
98
+ array('cakephp-', false),
99
+ array('cakephp-app', false),
100
+ array('cakephp-plugin', true),
101
+ array('chef-cookbook', true),
102
+ array('chef-role', true),
103
+ array('cockpit-module', true),
104
+ array('codeigniter-app', false),
105
+ array('codeigniter-library', true),
106
+ array('codeigniter-third-party', true),
107
+ array('codeigniter-module', true),
108
+ array('concrete5-block', true),
109
+ array('concrete5-package', true),
110
+ array('concrete5-theme', true),
111
+ array('concrete5-core', true),
112
+ array('concrete5-update', true),
113
+ array('craft-plugin', true),
114
+ array('croogo-plugin', true),
115
+ array('croogo-theme', true),
116
+ array('decibel-app', true),
117
+ array('dokuwiki-plugin', true),
118
+ array('dokuwiki-template', true),
119
+ array('drupal-module', true),
120
+ array('dolibarr-module', true),
121
+ array('ee3-theme', true),
122
+ array('ee3-addon', true),
123
+ array('ee2-theme', true),
124
+ array('ee2-addon', true),
125
+ array('elgg-plugin', true),
126
+ array('eliasis-component', true),
127
+ array('eliasis-module', true),
128
+ array('eliasis-plugin', true),
129
+ array('eliasis-template', true),
130
+ array('ezplatform-assets', true),
131
+ array('ezplatform-meta-assets', true),
132
+ array('fuel-module', true),
133
+ array('fuel-package', true),
134
+ array('fuel-theme', true),
135
+ array('fuelphp-component', true),
136
+ array('hurad-plugin', true),
137
+ array('hurad-theme', true),
138
+ array('imagecms-template', true),
139
+ array('imagecms-module', true),
140
+ array('imagecms-library', true),
141
+ array('itop-extension', true),
142
+ array('joomla-library', true),
143
+ array('kanboard-plugin', true),
144
+ array('kirby-plugin', true),
145
+ array('kohana-module', true),
146
+ array('lms-plugin', true),
147
+ array('lms-template', true),
148
+ array('lms-document-template', true),
149
+ array('lms-userpanel-module', true),
150
+ array('laravel-library', true),
151
+ array('lavalite-theme', true),
152
+ array('lavalite-package', true),
153
+ array('lithium-library', true),
154
+ array('magento-library', true),
155
+ array('majima-plugin', true),
156
+ array('mako-package', true),
157
+ array('modx-extra', true),
158
+ array('modxevo-snippet', true),
159
+ array('modxevo-plugin', true),
160
+ array('modxevo-module', true),
161
+ array('modxevo-template', true),
162
+ array('modxevo-lib', true),
163
+ array('mediawiki-extension', true),
164
+ array('mediawiki-skin', true),
165
+ array('microweber-module', true),
166
+ array('modulework-module', true),
167
+ array('moodle-mod', true),
168
+ array('october-module', true),
169
+ array('october-plugin', true),
170
+ array('piwik-plugin', true),
171
+ array('pxcms-module', true),
172
+ array('pxcms-theme', true),
173
+ array('phpbb-extension', true),
174
+ array('pimcore-plugin', true),
175
+ array('plentymarkets-plugin', true),
176
+ array('ppi-module', true),
177
+ array('prestashop-module', true),
178
+ array('prestashop-theme', true),
179
+ array('puppet-module', true),
180
+ array('porto-container', true),
181
+ array('radphp-bundle', true),
182
+ array('redaxo-addon', true),
183
+ array('redaxo-bestyle-plugin', true),
184
+ array('reindex-theme', true),
185
+ array('reindex-plugin', true),
186
+ array('roundcube-plugin', true),
187
+ array('shopware-backend-plugin', true),
188
+ array('shopware-core-plugin', true),
189
+ array('shopware-frontend-plugin', true),
190
+ array('shopware-theme', true),
191
+ array('shopware-plugin', true),
192
+ array('shopware-frontend-theme', true),
193
+ array('silverstripe-module', true),
194
+ array('silverstripe-theme', true),
195
+ array('smf-module', true),
196
+ array('smf-theme', true),
197
+ array('sydes-module', true),
198
+ array('sydes-theme', true),
199
+ array('symfony1-plugin', true),
200
+ array('thelia-module', true),
201
+ array('thelia-frontoffice-template', true),
202
+ array('thelia-backoffice-template', true),
203
+ array('thelia-email-template', true),
204
+ array('tusk-task', true),
205
+ array('tusk-asset', true),
206
+ array('typo3-flow-plugin', true),
207
+ array('typo3-cms-extension', true),
208
+ array('userfrosting-sprinkle', true),
209
+ array('vanilla-plugin', true),
210
+ array('vanilla-theme', true),
211
+ array('whmcs-gateway', true),
212
+ array('wolfcms-plugin', true),
213
+ array('wordpress-plugin', true),
214
+ array('wordpress-core', false),
215
+ array('yawik-module', true),
216
+ array('zend-library', true),
217
+ array('zikula-module', true),
218
+ array('zikula-theme', true),
219
+ array('kodicms-plugin', true),
220
+ array('kodicms-media', true),
221
+ array('phifty-bundle', true),
222
+ array('phifty-library', true),
223
+ array('phifty-framework', true),
224
+ array('osclass-plugin', true),
225
+ array('osclass-theme', true),
226
+ array('osclass-language', true),
227
+ );
228
+ }
229
+
230
+ /**
231
+ * testInstallPath
232
+ *
233
+ * @dataProvider dataForTestInstallPath
234
+ */
235
+ public function testInstallPath($type, $path, $name, $version = '1.0.0')
236
+ {
237
+ $installer = new Installer($this->io, $this->composer);
238
+ $package = new Package($name, $version, $version);
239
+
240
+ $package->setType($type);
241
+ $result = $installer->getInstallPath($package);
242
+ $this->assertEquals($path, $result);
243
+ }
244
+
245
+ /**
246
+ * dataFormTestInstallPath
247
+ */
248
+ public function dataForTestInstallPath()
249
+ {
250
+ return array(
251
+ array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
252
+ array('aimeos-extension', 'ext/ai-test/', 'author/ai-test'),
253
+ array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
254
+ array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
255
+ array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
256
+ array('attogram-module', 'modules/my_module/', 'author/my_module'),
257
+ array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
258
+ array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
259
+ array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
260
+ array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),
261
+ array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),
262
+ array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),
263
+ array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
264
+ array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
265
+ array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
266
+ array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
267
+ array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),
268
+ array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
269
+ array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
270
+ array('concrete5-block', 'application/blocks/concrete5_block/', 'remo/concrete5_block'),
271
+ array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
272
+ array('concrete5-theme', 'application/themes/concrete5_theme/', 'remo/concrete5_theme'),
273
+ array('concrete5-core', 'concrete/', 'concrete5/core'),
274
+ array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),
275
+ array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
276
+ array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
277
+ array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
278
+ array('decibel-app', 'app/someapp/', 'author/someapp'),
279
+ array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
280
+ array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
281
+ array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
282
+ array('drupal-module', 'modules/my_module/', 'shama/my_module'),
283
+ array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
284
+ array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
285
+ array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
286
+ array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
287
+ array('eliasis-component', 'components/my_component/', 'shama/my_component'),
288
+ array('eliasis-module', 'modules/my_module/', 'shama/my_module'),
289
+ array('eliasis-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
290
+ array('eliasis-template', 'templates/my_template/', 'shama/my_template'),
291
+ array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
292
+ array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
293
+ array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),
294
+ array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),
295
+ array('ezplatform-assets', 'web/assets/ezplatform/ezplatform_comp/', 'author/ezplatform_comp'),
296
+ array('ezplatform-meta-assets', 'web/assets/ezplatform/', 'author/ezplatform_comp'),
297
+ array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
298
+ array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
299
+ array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
300
+ array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
301
+ array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
302
+ array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
303
+ array('imagecms-template', 'templates/my_template/', 'shama/my_template'),
304
+ array('imagecms-module', 'application/modules/my_module/', 'shama/my_module'),
305
+ array('imagecms-library', 'application/libraries/my_library/', 'shama/my_library'),
306
+ array('itop-extension', 'extensions/my_extension/', 'shama/my_extension'),
307
+ array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
308
+ array('kanboard-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
309
+ array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
310
+ array('kohana-module', 'modules/my_package/', 'shama/my_package'),
311
+ array('lms-plugin', 'plugins/MyPackage/', 'shama/MyPackage'),
312
+ array('lms-plugin', 'plugins/MyPackage/', 'shama/my_package'),
313
+ array('lms-template', 'templates/MyPackage/', 'shama/MyPackage'),
314
+ array('lms-template', 'templates/MyPackage/', 'shama/my_package'),
315
+ array('lms-document-template', 'documents/templates/MyPackage/', 'shama/MyPackage'),
316
+ array('lms-document-template', 'documents/templates/MyPackage/', 'shama/my_package'),
317
+ array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/MyPackage'),
318
+ array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/my_package'),
319
+ array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
320
+ array('lavalite-theme', 'public/themes/my_theme/', 'shama/my_theme'),
321
+ array('lavalite-package', 'packages/my_group/my_package/', 'my_group/my_package'),
322
+ array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
323
+ array('magento-library', 'lib/foo/', 'test/foo'),
324
+ array('majima-plugin', 'plugins/MyPlugin/', 'shama/my-plugin'),
325
+ array('modx-extra', 'core/packages/extra/', 'vendor/extra'),
326
+ array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),
327
+ array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),
328
+ array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),
329
+ array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),
330
+ array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),
331
+ array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
332
+ array('mediawiki-extension', 'extensions/APC/', 'author/APC'),
333
+ array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),
334
+ array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),
335
+ array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),
336
+ array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),
337
+ array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),
338
+ array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),
339
+ array('modulework-module', 'modules/my_package/', 'shama/my_package'),
340
+ array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
341
+ array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
342
+ array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
343
+ array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
344
+ array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
345
+ array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
346
+ array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),
347
+ array('pxcms-module', 'app/Modules/Foo/', 'vendor/module-foo'),
348
+ array('pxcms-module', 'app/Modules/Foo/', 'vendor/pxcms-foo'),
349
+ array('pxcms-theme', 'themes/Foo/', 'vendor/theme-foo'),
350
+ array('pxcms-theme', 'themes/Foo/', 'vendor/pxcms-foo'),
351
+ array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
352
+ array('phpbb-style', 'styles/foo/', 'test/foo'),
353
+ array('phpbb-language', 'language/foo/', 'test/foo'),
354
+ array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
355
+ array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
356
+ array('ppi-module', 'modules/foo/', 'test/foo'),
357
+ array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
358
+ array('porto-container', 'app/Containers/container-name/', 'test/container-name'),
359
+ array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
360
+ array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
361
+ array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
362
+ array('reindex-theme', 'themes/my_module/', 'author/my_module'),
363
+ array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),
364
+ array('roundcube-plugin', 'plugins/base/', 'test/base'),
365
+ array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
366
+ array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
367
+ array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
368
+ array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
369
+ array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
370
+ array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),
371
+ array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),
372
+ array('silverstripe-module', 'my_module/', 'shama/my_module'),
373
+ array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
374
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
375
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
376
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
377
+ array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
378
+ array('smf-module', 'Sources/my_module/', 'shama/my_module'),
379
+ array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),
380
+ array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
381
+ array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
382
+ array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),
383
+ array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),
384
+ array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),
385
+ array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),
386
+ array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),
387
+ array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
388
+ array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
389
+ array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
390
+ array('userfrosting-sprinkle', 'app/sprinkles/my_sprinkle/', 'shama/my_sprinkle'),
391
+ array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
392
+ array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
393
+ array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
394
+ array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
395
+ array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
396
+ array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
397
+ array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
398
+ array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
399
+ array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
400
+ array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
401
+ array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
402
+ array('phifty-bundle', 'bundles/core/', 'shama/core'),
403
+ array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
404
+ array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
405
+ array('yawik-module', 'module/MyModule/', 'shama/my_module'),
406
+ array('osclass-plugin', 'oc-content/plugins/sample_plugin/', 'test/sample_plugin'),
407
+ array('osclass-theme', 'oc-content/themes/sample_theme/', 'test/sample_theme'),
408
+ array('osclass-language', 'oc-content/languages/sample_lang/', 'test/sample_lang'),
409
+ );
410
+ }
411
+
412
+ /**
413
+ * testGetCakePHPInstallPathException
414
+ *
415
+ * @return void
416
+ *
417
+ * @expectedException \InvalidArgumentException
418
+ */
419
+ public function testGetCakePHPInstallPathException()
420
+ {
421
+ $installer = new Installer($this->io, $this->composer);
422
+ $package = new Package('shama/ftp', '1.0.0', '1.0.0');
423
+
424
+ $package->setType('cakephp-whoops');
425
+ $result = $installer->getInstallPath($package);
426
+ }
427
+
428
+ /**
429
+ * testCustomInstallPath
430
+ */
431
+ public function testCustomInstallPath()
432
+ {
433
+ $installer = new Installer($this->io, $this->composer);
434
+ $package = new Package('shama/ftp', '1.0.0', '1.0.0');
435
+ $package->setType('cakephp-plugin');
436
+ $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
437
+ $this->composer->setPackage($consumerPackage);
438
+ $consumerPackage->setExtra(array(
439
+ 'installer-paths' => array(
440
+ 'my/custom/path/{$name}/' => array(
441
+ 'shama/ftp',
442
+ 'foo/bar',
443
+ ),
444
+ ),
445
+ ));
446
+ $result = $installer->getInstallPath($package);
447
+ $this->assertEquals('my/custom/path/Ftp/', $result);
448
+ }
449
+
450
+ /**
451
+ * testCustomInstallerName
452
+ */
453
+ public function testCustomInstallerName()
454
+ {
455
+ $installer = new Installer($this->io, $this->composer);
456
+ $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
457
+ $package->setType('cakephp-plugin');
458
+ $package->setExtra(array(
459
+ 'installer-name' => 'FTP',
460
+ ));
461
+ $result = $installer->getInstallPath($package);
462
+ $this->assertEquals('Plugin/FTP/', $result);
463
+ }
464
+
465
+ /**
466
+ * testCustomTypePath
467
+ */
468
+ public function testCustomTypePath()
469
+ {
470
+ $installer = new Installer($this->io, $this->composer);
471
+ $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
472
+ $package->setType('wordpress-plugin');
473
+ $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
474
+ $this->composer->setPackage($consumerPackage);
475
+ $consumerPackage->setExtra(array(
476
+ 'installer-paths' => array(
477
+ 'my/custom/path/{$name}/' => array(
478
+ 'type:wordpress-plugin'
479
+ ),
480
+ ),
481
+ ));
482
+ $result = $installer->getInstallPath($package);
483
+ $this->assertEquals('my/custom/path/my_plugin/', $result);
484
+ }
485
+
486
+ /**
487
+ * testVendorPath
488
+ */
489
+ public function testVendorPath()
490
+ {
491
+ $installer = new Installer($this->io, $this->composer);
492
+ $package = new Package('penyaskito/my_module', '1.0.0', '1.0.0');
493
+ $package->setType('drupal-module');
494
+ $consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0');
495
+ $this->composer->setPackage($consumerPackage);
496
+ $consumerPackage->setExtra(array(
497
+ 'installer-paths' => array(
498
+ 'modules/custom/{$name}/' => array(
499
+ 'vendor:penyaskito'
500
+ ),
501
+ ),
502
+ ));
503
+ $result = $installer->getInstallPath($package);
504
+ $this->assertEquals('modules/custom/my_module/', $result);
505
+ }
506
+
507
+ /**
508
+ * testNoVendorName
509
+ */
510
+ public function testNoVendorName()
511
+ {
512
+ $installer = new Installer($this->io, $this->composer);
513
+ $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
514
+
515
+ $package->setType('symfony1-plugin');
516
+ $result = $installer->getInstallPath($package);
517
+ $this->assertEquals('plugins/sfPhpunitPlugin/', $result);
518
+ }
519
+
520
+ /**
521
+ * testTypo3Inflection
522
+ */
523
+ public function testTypo3Inflection()
524
+ {
525
+ $installer = new Installer($this->io, $this->composer);
526
+ $package = new Package('typo3/fluid', '1.0.0', '1.0.0');
527
+
528
+ $package->setAutoload(array(
529
+ 'psr-0' => array(
530
+ 'TYPO3\\Fluid' => 'Classes',
531
+ ),
532
+ ));
533
+
534
+ $package->setType('typo3-flow-package');
535
+ $result = $installer->getInstallPath($package);
536
+ $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
537
+ }
538
+
539
+ public function testUninstallAndDeletePackageFromLocalRepo()
540
+ {
541
+ $package = new Package('foo', '1.0.0', '1.0.0');
542
+
543
+ $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
544
+ $installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
545
+
546
+ $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
547
+ $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
548
+ $repo->expects($this->once())->method('removePackage')->with($package);
549
+
550
+ $installer->uninstall($repo, $package);
551
+ }
552
+ }
vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\MayaInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase as BaseTestCase;
8
+
9
+ class MayaInstallerTest extends BaseTestCase
10
+ {
11
+ /**
12
+ * @var MayaInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new MayaInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ array('name' => $expected, 'type' => $type),
31
+ $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ // Should keep module name StudlyCase
39
+ array(
40
+ 'maya-module',
41
+ 'user-profile',
42
+ 'UserProfile'
43
+ ),
44
+ array(
45
+ 'maya-module',
46
+ 'maya-module',
47
+ 'Maya'
48
+ ),
49
+ array(
50
+ 'maya-module',
51
+ 'blog',
52
+ 'Blog'
53
+ ),
54
+ // tests that exactly one '-module' is cut off
55
+ array(
56
+ 'maya-module',
57
+ 'some-module-module',
58
+ 'SomeModule',
59
+ ),
60
+ );
61
+ }
62
+ }
vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\MediaWikiInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase as BaseTestCase;
8
+
9
+ class MediaWikiInstallerTest extends BaseTestCase
10
+ {
11
+ /**
12
+ * @var MediaWikiInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new MediaWikiInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
31
+ array('name' => $expected, 'type'=>$type)
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ array(
39
+ 'mediawiki-extension',
40
+ 'sub-page-list',
41
+ 'SubPageList',
42
+ ),
43
+ array(
44
+ 'mediawiki-extension',
45
+ 'sub-page-list-extension',
46
+ 'SubPageList',
47
+ ),
48
+ array(
49
+ 'mediawiki-extension',
50
+ 'semantic-mediawiki',
51
+ 'SemanticMediawiki',
52
+ ),
53
+ // tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions
54
+ array(
55
+ 'mediawiki-skin',
56
+ 'some-skin-skin',
57
+ 'some-skin',
58
+ ),
59
+ // tests that names without '-skin' suffix stay valid
60
+ array(
61
+ 'mediawiki-skin',
62
+ 'someotherskin',
63
+ 'someotherskin',
64
+ ),
65
+ );
66
+ }
67
+ }
vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\OctoberInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase as BaseTestCase;
8
+
9
+ class OctoberInstallerTest extends BaseTestCase
10
+ {
11
+ /**
12
+ * @var OctoberInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new OctoberInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
31
+ array('name' => $expected, 'type' => $type)
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ array(
39
+ 'october-plugin',
40
+ 'subpagelist',
41
+ 'subpagelist',
42
+ ),
43
+ array(
44
+ 'october-plugin',
45
+ 'subpagelist-plugin',
46
+ 'subpagelist',
47
+ ),
48
+ array(
49
+ 'october-plugin',
50
+ 'semanticoctober',
51
+ 'semanticoctober',
52
+ ),
53
+ // tests that exactly one '-theme' is cut off
54
+ array(
55
+ 'october-theme',
56
+ 'some-theme-theme',
57
+ 'some-theme',
58
+ ),
59
+ // tests that names without '-theme' suffix stay valid
60
+ array(
61
+ 'october-theme',
62
+ 'someothertheme',
63
+ 'someothertheme',
64
+ ),
65
+ );
66
+ }
67
+ }
vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\OntoWikiInstaller;
5
+ use PHPUnit\Framework\TestCase as BaseTestCase;
6
+
7
+ /**
8
+ * Test for the OntoWikiInstaller
9
+ * code was taken from DokuWikiInstaller
10
+ */
11
+ class OntoWikiInstallerTest extends BaseTestCase
12
+ {
13
+ /**
14
+ * @var OntoWikiInstaller
15
+ */
16
+ private $installer;
17
+
18
+ public function setUp()
19
+ {
20
+ $this->installer = new OntoWikiInstaller();
21
+ }
22
+
23
+ /**
24
+ * @dataProvider packageNameInflectionProvider
25
+ */
26
+ public function testInflectPackageVars($type, $name, $expected)
27
+ {
28
+ $this->assertEquals(
29
+ $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
30
+ array('name' => $expected, 'type'=>$type)
31
+ );
32
+ }
33
+
34
+ public function packageNameInflectionProvider()
35
+ {
36
+ return array(
37
+ array(
38
+ 'ontowiki-extension',
39
+ 'CSVImport.ontowiki',
40
+ 'csvimport',
41
+ ),
42
+ array(
43
+ 'ontowiki-extension',
44
+ 'csvimport',
45
+ 'csvimport',
46
+ ),
47
+ array(
48
+ 'ontowiki-extension',
49
+ 'some_ontowiki_extension',
50
+ 'some_ontowiki_extension',
51
+ ),
52
+ array(
53
+ 'ontowiki-extension',
54
+ 'some_ontowiki_extension.ontowiki',
55
+ 'some_ontowiki_extension',
56
+ ),
57
+ array(
58
+ 'ontowiki-translation',
59
+ 'de-translation.ontowiki',
60
+ 'de',
61
+ ),
62
+ array(
63
+ 'ontowiki-translation',
64
+ 'en-US-translation.ontowiki',
65
+ 'en-us',
66
+ ),
67
+ array(
68
+ 'ontowiki-translation',
69
+ 'en-US-translation',
70
+ 'en-us',
71
+ ),
72
+ array(
73
+ 'ontowiki-theme',
74
+ 'blue-theme.ontowiki',
75
+ 'blue',
76
+ ),
77
+ array(
78
+ 'ontowiki-theme',
79
+ 'blue-theme',
80
+ 'blue',
81
+ ),
82
+ );
83
+ }
84
+ }
vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php 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/SiteDirectInstallerTest.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers\Test;
4
+
5
+ use Composer\Composer;
6
+ use Composer\Installers\SiteDirectInstaller;
7
+ use Composer\Package\Package;
8
+
9
+ class SiteDirectInstallerTest extends TestCase
10
+ {
11
+ /** @var SiteDirectInstaller $installer */
12
+ protected $installer;
13
+
14
+ /** @var Package */
15
+ private $package;
16
+
17
+ public function SetUp()
18
+ {
19
+ $this->package = new Package('sitedirect/some_name', '1.0.9', '1.0');
20
+ $this->installer = new SiteDirectInstaller(
21
+ $this->package,
22
+ new Composer()
23
+ );
24
+
25
+ }
26
+
27
+ /**
28
+ * @dataProvider dataProvider
29
+ */
30
+ public function testInflectPackageVars($data, $expected)
31
+ {
32
+ $result = $this->installer->inflectPackageVars($data);
33
+ $this->assertEquals($result, $expected);
34
+ }
35
+
36
+ /**
37
+ * @dataProvider dataProvider
38
+ */
39
+ public function testInstallPath($data, $expected)
40
+ {
41
+ $result = $this->installer->inflectPackageVars($data);
42
+ $path = $this->createPackage($data);
43
+
44
+ // use $result to get the proper capitalization for the vendor path
45
+ $expectedPath = "modules/{$result['vendor']}/{$result['name']}/";
46
+ $notExpectedPath = "modules/{$data['vendor']}/{$data['name']}/";
47
+ $this->assertEquals($expectedPath, $path);
48
+ $this->assertNotEquals($notExpectedPath, $path);
49
+ }
50
+
51
+ /**
52
+ * @param $data
53
+ * @return string
54
+ */
55
+ private function createPackage($data)
56
+ {
57
+ $fullName = "{$data['vendor']}/{$data['name']}";
58
+
59
+ $package = new Package($fullName, '1.0', '1.0');
60
+ $package->setType('sitedirect-module');
61
+ $installer = new SiteDirectInstaller($package, new Composer());
62
+
63
+ $path = $installer->getInstallPath($package, 'sitedirect');
64
+ return $path;
65
+ }
66
+
67
+ public function dataProvider()
68
+ {
69
+ return array(
70
+ array(
71
+ 'data' => array(
72
+ 'name' => 'kernel',
73
+ 'vendor' => 'sitedirect',
74
+ 'type' => 'sitedirect-module',
75
+ ),
76
+ 'expected' => array(
77
+ 'name' => 'Kernel',
78
+ 'vendor' => 'SiteDirect',
79
+ 'type' => 'sitedirect-module',
80
+ )
81
+ ),
82
+ array(
83
+ 'data' => array(
84
+ 'name' => 'that_guy',
85
+ 'vendor' => 'whatGuy',
86
+ 'type' => 'sitedirect-module',
87
+ ),
88
+ 'expected' => array(
89
+ 'name' => 'ThatGuy',
90
+ 'vendor' => 'whatGuy',
91
+ 'type' => 'sitedirect-module',
92
+ )
93
+ ),
94
+ array(
95
+ 'data' => array(
96
+ 'name' => 'checkout',
97
+ 'vendor' => 'someVendor',
98
+ 'type' => 'sitedirect-plugin',
99
+ ),
100
+ 'expected' => array(
101
+ 'name' => 'Checkout',
102
+ 'vendor' => 'someVendor',
103
+ 'type' => 'sitedirect-plugin',
104
+ )
105
+ ),
106
+ array(
107
+ 'data' => array(
108
+ 'name' => 'checkout',
109
+ 'vendor' => 'siteDirect',
110
+ 'type' => 'sitedirect-plugin',
111
+ ),
112
+ 'expected' => array(
113
+ 'name' => 'Checkout',
114
+ 'vendor' => 'SiteDirect',
115
+ 'type' => 'sitedirect-plugin',
116
+ )
117
+ ),
118
+ );
119
+ }
120
+ }
vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\SyDESInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase as BaseTestCase;
8
+
9
+ class SyDESInstallerTest extends BaseTestCase
10
+ {
11
+ /**
12
+ * @var SyDESInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new SyDESInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ array('name' => $expected, 'type' => $type),
31
+ $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ // modules
39
+ array(
40
+ 'sydes-module',
41
+ 'name',
42
+ 'Name'
43
+ ),
44
+ array(
45
+ 'sydes-module',
46
+ 'sample-name',
47
+ 'SampleName'
48
+ ),
49
+ array(
50
+ 'sydes-module',
51
+ 'sydes-name',
52
+ 'Name'
53
+ ),
54
+ array(
55
+ 'sydes-module',
56
+ 'sample-name-module',
57
+ 'SampleName',
58
+ ),
59
+ array(
60
+ 'sydes-module',
61
+ 'sydes-sample-name-module',
62
+ 'SampleName'
63
+ ),
64
+ // themes
65
+ array(
66
+ 'sydes-theme',
67
+ 'some-theme-theme',
68
+ 'some-theme',
69
+ ),
70
+ array(
71
+ 'sydes-theme',
72
+ 'sydes-sometheme',
73
+ 'sometheme',
74
+ ),
75
+ array(
76
+ 'sydes-theme',
77
+ 'Sample-Name',
78
+ 'sample-name'
79
+ ),
80
+ );
81
+ }
82
+ }
vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Installers\Test;
14
+
15
+ use Composer\Package\Version\VersionParser;
16
+ use Composer\Package\Package;
17
+ use Composer\Package\AliasPackage;
18
+ use Composer\Package\LinkConstraint\VersionConstraint;
19
+ use Composer\Util\Filesystem;
20
+ use PHPUnit\Framework\TestCase as BaseTestCase;
21
+
22
+ abstract class TestCase extends BaseTestCase
23
+ {
24
+ private static $parser;
25
+
26
+ protected static function getVersionParser()
27
+ {
28
+ if (!self::$parser) {
29
+ self::$parser = new VersionParser();
30
+ }
31
+
32
+ return self::$parser;
33
+ }
34
+
35
+ protected function getVersionConstraint($operator, $version)
36
+ {
37
+ return new VersionConstraint(
38
+ $operator,
39
+ self::getVersionParser()->normalize($version)
40
+ );
41
+ }
42
+
43
+ protected function getPackage($name, $version)
44
+ {
45
+ $normVersion = self::getVersionParser()->normalize($version);
46
+
47
+ return new Package($name, $normVersion, $version);
48
+ }
49
+
50
+ protected function getAliasPackage($package, $version)
51
+ {
52
+ $normVersion = self::getVersionParser()->normalize($version);
53
+
54
+ return new AliasPackage($package, $normVersion, $version);
55
+ }
56
+
57
+ protected function ensureDirectoryExistsAndClear($directory)
58
+ {
59
+ $fs = new Filesystem();
60
+ if (is_dir($directory)) {
61
+ $fs->removeDirectory($directory);
62
+ }
63
+ mkdir($directory, 0777, true);
64
+ }
65
+ }
vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\VgmcpInstaller;
5
+ use Composer\Package\Package;
6
+ use Composer\Composer;
7
+ use PHPUnit\Framework\TestCase as BaseTestCase;
8
+
9
+ class VgmcpInstallerTest extends BaseTestCase
10
+ {
11
+ /**
12
+ * @var VgmcpInstaller
13
+ */
14
+ private $installer;
15
+
16
+ public function setUp()
17
+ {
18
+ $this->installer = new VgmcpInstaller(
19
+ new Package('NyanCat', '4.2', '4.2'),
20
+ new Composer()
21
+ );
22
+ }
23
+
24
+ /**
25
+ * @dataProvider packageNameInflectionProvider
26
+ */
27
+ public function testInflectPackageVars($type, $name, $expected)
28
+ {
29
+ $this->assertEquals(
30
+ array('name' => $expected, 'type' => $type),
31
+ $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
+ );
33
+ }
34
+
35
+ public function packageNameInflectionProvider()
36
+ {
37
+ return array(
38
+ // Should keep bundle name StudlyCase
39
+ array(
40
+ 'vgmcp-bundle',
41
+ 'user-profile',
42
+ 'UserProfile'
43
+ ),
44
+ array(
45
+ 'vgmcp-bundle',
46
+ 'vgmcp-bundle',
47
+ 'Vgmcp'
48
+ ),
49
+ array(
50
+ 'vgmcp-bundle',
51
+ 'blog',
52
+ 'Blog'
53
+ ),
54
+ // tests that exactly one '-bundle' is cut off
55
+ array(
56
+ 'vgmcp-bundle',
57
+ 'some-bundle-bundle',
58
+ 'SomeBundle',
59
+ ),
60
+ // tests that exactly one '-theme' is cut off
61
+ array(
62
+ 'vgmcp-theme',
63
+ 'some-theme-theme',
64
+ 'SomeTheme',
65
+ ),
66
+ // tests that names without '-theme' suffix stay valid
67
+ array(
68
+ 'vgmcp-theme',
69
+ 'someothertheme',
70
+ 'Someothertheme',
71
+ ),
72
+ // Should keep theme name StudlyCase
73
+ array(
74
+ 'vgmcp-theme',
75
+ 'adminlte-advanced',
76
+ 'AdminlteAdvanced'
77
+ ),
78
+ );
79
+ }
80
+ }
vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Composer;
5
+ use Composer\Installers\YawikInstaller;
6
+ use Composer\Package\Package;
7
+ use Composer\Package\PackageInterface;
8
+
9
+ /**
10
+ * Class YawikInstallerTest
11
+ *
12
+ * @package Composer\Installers\Test
13
+ */
14
+ class YawikInstallerTest extends TestCase
15
+ {
16
+ /**
17
+ * @varComposer
18
+ */
19
+ private $composer;
20
+
21
+ /**
22
+ * @var PackageInterface
23
+ */
24
+ private $io;
25
+
26
+ /**
27
+ * @var Package
28
+ */
29
+ private $package;
30
+
31
+ /**
32
+ * setUp
33
+ *
34
+ * @return void
35
+ */
36
+ public function setUp()
37
+ {
38
+ $this->package = new Package('YawikCompanyRegistration', '1.0', '1.0');
39
+ $this->io = $this->getMock('Composer\IO\PackageInterface');
40
+ $this->composer = new Composer();
41
+ }
42
+
43
+ /**
44
+ * testInflectPackageVars
45
+ *
46
+ * @dataProvider packageNameProvider
47
+ * @return void
48
+ */
49
+ public function testInflectPackageVars($input)
50
+ {
51
+ $installer = new YawikInstaller($this->package, $this->composer);
52
+ $result = $installer->inflectPackageVars(array('name' => $input));
53
+ $this->assertEquals($result, array('name' => 'YawikCompanyRegistration'));
54
+ }
55
+
56
+ public function packageNameProvider()
57
+ {
58
+ return array(
59
+ array('yawik-company-registration'),
60
+ array('yawik_company_registration'),
61
+ array('YawikCompanyRegistration')
62
+ );
63
+ }
64
+ }
vendor/composer/installers/tests/bootstrap.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+
3
+ $loader = require __DIR__ . '/../src/bootstrap.php';
4
+ $loader->add('Composer\Installers\Test', __DIR__);
wp-dependencies.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "Classic Editor",
4
+ "host": "wordpress",
5
+ "slug": "classic-editor/classic-editor.php",
6
+ "uri": "https://wordpress.org/plugins/classic-editor/",
7
+ "branch": "trunk"
8
+ }
9
+ ]