PK cPQ.g .travis.ymlnu ٘ language: php
dist: trusty
git:
depth: 5
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- nightly
jobs:
include:
- dist: precise
php: 5.3
env: DEPS=
- dist: precise
php: 5.3
env: DEPS=--prefer-lowest
fast_finish: true
allow_failures:
- php: nightly
before_script:
- composer self-update
- composer update $DEPS
script:
- vendor/bin/composer test
PK cPQ6V _config.ymlnu ٘ theme: jekyll-theme-caymanPK cPQb, , README.mdnu ٘ # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
[![Build Status](http://img.shields.io/travis/composer/installers.svg)](http://travis-ci.org/composer/installers)
This is for PHP package authors to require in their `composer.json`. It will
install their package to the correct location based on the specified package
type.
The goal of Installers is to be a simple package type to install path map.
Users can also customize the install path per package and package authors can
modify the package name upon installing.
Installers isn't intended on replacing all custom installers. If your
package requires special installation handling then by all means, [create a
custom installer to handle it](https://getcomposer.org/doc/articles/custom-installers.md).
**Natively Supported Frameworks**:
The following frameworks natively work with Composer and will be
installed to the default `vendor` directory. `composer/installers`
is not needed to install packages with these frameworks:
* Aura
* Symfony2
* Yii
* Yii2
## Current Supported Package Types
> Stable types are marked as **bold**, this means that installation paths
> for those type will not be changed. Any adjustment for those types would
> require creation of brand new type that will cover required changes.
| Framework | Types
| --------- | -----
| Aimeos | `aimeos-extension`
| Asgard | `asgard-module`
`asgard-theme`
| Attogram | `attogram-module`
| AGL | `agl-module`
| Bonefish | `bonefish-package`
| AnnotateCms | `annotatecms-module`
`annotatecms-component`
`annotatecms-service`
| Bitrix | `bitrix-module` (deprecated)
`bitrix-component` (deprecated)
`bitrix-theme` (deprecated)
`bitrix-d7-module`
`bitrix-d7-component`
`bitrix-d7-template`
| CakePHP 2+ | **`cakephp-plugin`**
| Chef | `chef-cookbook`
`chef-role`
| CiviCrm | `civicrm-ext`
| CCFramework | `ccframework-ship`
`ccframework-theme`
| Cockpit | `cockpit-module`
| CodeIgniter | `codeigniter-library`
`codeigniter-third-party`
`codeigniter-module`
| concrete5 | `concrete5-core`
`concrete5-package`
`concrete5-theme`
`concrete5-block`
`concrete5-update`
| Craft | `craft-plugin`
| Croogo | `croogo-plugin`
`croogo-theme`
| Decibel | `decibel-app`
| Dframe | `dframe-module`
| DokuWiki | `dokuwiki-plugin`
`dokuwiki-template`
| Dolibarr | `dolibarr-module`
| Drupal | `drupal-core`
`drupal-module`
`drupal-theme`
`drupal-library`
`drupal-profile`
`drupal-database-driver`
`drupal-drush`
`drupal-custom-theme`
`drupal-custom-module`
`drupal-custom-profile`
`drupal-drupal-multisite`
`drupal-console`
`drupal-console-language`
`drupal-config`
| Elgg | `elgg-plugin`
| Eliasis | `eliasis-component`
`eliasis-module`
`eliasis-plugin`
`eliasis-template`
| ExpressionEngine 3 | `ee3-addon`
`ee3-theme`
| eZ Platform | `ezplatform-assets`
`ezplatform-meta-assets`
| FuelPHP v1.x | `fuel-module`
`fuel-package`
`fuel-theme`
| FuelPHP v2.x | `fuelphp-component`
| Grav | `grav-plugin`
`grav-theme`
| Hurad | `hurad-plugin`
`hurad-theme`
| ImageCMS | `imagecms-template`
`imagecms-module`
`imagecms-library`
| iTop | `itop-extension`
| Joomla | `joomla-component`
`joomla-module`
`joomla-template`
`joomla-plugin`
`joomla-library`
| Kanboard | `kanboard-plugin`
| Kirby | **`kirby-plugin`**
`kirby-field`
`kirby-tag`
| Known | `known-plugin`
`known-theme`
`known-console`
| KodiCMS | `kodicms-plugin`
`kodicms-media`
| Kohana | **`kohana-module`**
| Lan Management System | `lms-plugin`
`lms-template`
`lms-document-template`
`lms-userpanel-module`
| Laravel | `laravel-library`
| Lavalite | `lavalite-theme`
`lavalite-package`
| Lithium | **`lithium-library`
`lithium-source`**
| Magento | `magento-library`
`magento-skin`
`magento-theme`
| majima | `majima-plugin`
| Mako | `mako-package`
| MantisBT | `mantisbt-plugin`
| Mautic | `mautic-plugin`
`mautic-theme`
| Maya | `maya-module`
| MODX | `modx-extra`
| MODX Evo | `modxevo-snippet`
`modxevo-plugin`
`modxevo-module`
`modxevo-template`
`modxevo-lib`
| MediaWiki | `mediawiki-extension`
| October | **`october-module`
`october-plugin`
`october-theme`**
| OntoWiki | `ontowiki-extension`
`ontowiki-theme`
`ontowiki-translation`
| OXID | `oxid-module`
`oxid-theme`
`oxid-out`
| Osclass | `osclass-plugin`
`osclass-theme`
`osclass-language`
| MODULEWork | `modulework-module`
| Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
| Piwik | `piwik-plugin`
| phpBB | `phpbb-extension`
`phpbb-style`
`phpbb-language`
| Pimcore | `pimcore-plugin`(deprecated, only used for versions <= 4)
| Plentymarkets | `plentymarkets-plugin`
| PPI | **`ppi-module`**
| Puppet | `puppet-module`
| Porto | `porto-container`
| RadPHP | `radphp-bundle`
| REDAXO | `redaxo-addon`
| REDAXO bestyle-plugin | `redaxo-bestyle-plugin`
| REDAXO V5.* | `redaxo5-addon`
| REDAXO V5.* bestyle-plugin | `redaxo5-bestyle-plugin`
| ReIndex | **`reindex-plugin`**
**`reindex-theme`**
| Roundcube | `roundcube-plugin`
| shopware | `shopware-backend-plugin`
`shopware-core-plugin`
`shopware-frontend-plugin`
`shopware-theme`
`shopware-plugin`
`shopware-frontend-theme`
| SilverStripe | `silverstripe-module`
`silverstripe-theme`
| SiteDirect | `sitedirect-module`
`sitedirect-plugin`
| SMF | `smf-module`
`smf-theme`
| SyDES | `sydes-module`
`sydes-theme`
| Sylius | `sylius-theme`
| symfony1 | **`symfony1-plugin`**
| TAO | `tao-extension`
| Tusk | `tusk-task`
`tusk-command`
`tusk-asset`
| TYPO3 Flow | `typo3-flow-package`
`typo3-flow-framework`
`typo3-flow-plugin`
`typo3-flow-site`
`typo3-flow-boilerplate`
`typo3-flow-build`
| TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
| UserFrosting | `userfrosting-sprinkle`
| Vanilla | `vanilla-plugin`
`vanilla-theme`
| Vgmcp | `vgmcp-bundle`
`vgmcp-theme`
| WHMCS | `whmcs-addons`
`whmcs-fraud`
`whmcs-gateways`
`whmcs-notifications`
`whmcs-registrars`
`whmcs-reports`
`whmcs-security`
`whmcs-servers`
`whmcs-social`
`whmcs-support`
`whmcs-templates`
`whmcs-includes`
| Wolf CMS | `wolfcms-plugin`
| WordPress | `wordpress-plugin`
`wordpress-theme`
`wordpress-muplugin`
`wordpress-dropin`
| YAWIK | `yawik-module`
| Zend | `zend-library`
`zend-extra`
`zend-module`
| Zikula | `zikula-module`
`zikula-theme`
| Prestashop | `prestashop-module`
`prestashop-theme`
| Phifty | `phifty-bundle`
`phifty-framework`
`phifty-library`
## Example `composer.json` File
This is an example for a CakePHP plugin. The only important parts to set in your
composer.json file are `"type": "cakephp-plugin"` which describes what your
package is and `"require": { "composer/installers": "~1.0" }` which tells composer
to load the custom installers.
```json
{
"name": "you/ftp",
"type": "cakephp-plugin",
"require": {
"composer/installers": "~1.0"
}
}
```
This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
when a user runs `php composer.phar install`.
So submit your packages to [packagist.org](http://packagist.org)!
## Custom Install Paths
If you are consuming a package that uses the `composer/installers` you can
override the install path with the following extra in your `composer.json`:
```json
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
}
}
}
```
A package type can have a custom installation path with a `type:` prefix.
``` json
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["type:wordpress-plugin"]
}
}
}
```
You can also have the same vendor packages with a custom installation path by
using the `vendor:` prefix.
``` json
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["vendor:my_organization"]
}
}
}
```
These would use your custom path for each of the listed packages. The available
variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
## Custom Install Names
If you're a package author and need your package to be named differently when
installed consider using the `installer-name` extra.
For example you have a package named `shama/cakephp-ftp` with the type
`cakephp-plugin`. Installing with `composer/installers` would install to the
path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
package author actually need the package to be named and installed to
`Plugin/Ftp`. Using the following config within your **package** `composer.json`
will allow this:
```json
{
"name": "shama/cakephp-ftp",
"type": "cakephp-plugin",
"extra": {
"installer-name": "Ftp"
}
}
```
Please note the name entered into `installer-name` will be the final and will
not be inflected.
## Disabling installers
There may be time when you want to disable one or more installers from `composer/installers`.
For example, if you are managing a package or project that uses a framework specific installer that
conflicts with `composer/installers` but also have a dependency on a package that depends on `composer/installers`.
Installers can be disabled for your project by specifying the extra
`installer-disable` property. If set to `true`, `"all"`, or `"*"` all installers
will be disabled.
```json
{
"extra": {
"installer-disable": true
}
}
```
Otherwise a single installer or an array of installers may be specified.
```json
{
"extra": {
"installer-disable": [
"cakephp",
"drupal"
]
}
}
```
**Note:** Using a global disable value (`true`, `"all"`, or `"*"`) will take precedence over individual
installer names if used in an array. The example below will disable all installers.
```json
{
"extra": {
"installer-disable": [
"drupal",
"all"
]
}
}
```
## Should we allow dynamic package types or paths? No.
What are they? The ability for a package author to determine where a package
will be installed either through setting the path directly in their
`composer.json` or through a dynamic package type: `"type":
"framework-install-here"`.
It has been proposed many times. Even implemented once early on and then
removed. Installers won't do this because it would allow a single package
author to wipe out entire folders without the user's consent. That user would
then come here to yell at us.
Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.
PK cPQk CONTRIBUTING.mdnu ٘ # Contributing
If you would like to help, please take a look at the list of
[issues](https://github.com/composer/installers/issues).
## Pull requests
* [Fork and clone](https://help.github.com/articles/fork-a-repo).
* Run the command `php composer.phar install` to install dependencies.
* Use the command `phpunit` to run the tests.
* Create a branch, commit, push and send us a
[pull request](https://help.github.com/articles/using-pull-requests).
To ensure a consistent code base, you should make sure the code follows the
coding standards [PSR-1](http://www.php-fig.org/psr/psr-1/) and
[PSR-2](http://www.php-fig.org/psr/psr-2/).
## Creating a new Installer
* Create a class with your Installer that extends `Composer\Installers\BaseInstaller`.
* Add your Installer to `Composer\Installers\Installer::$supportedTypes`.
* Create unit tests as a separate class or as part of `Composer\Installers\Test\InstallerTest`.
* Add information about your Installer to `README.md` in section "Current Supported Package Types".
* Run the tests.
PK cPQ0L
.gitignorenu ٘ vendor/
composer.lock
.idea/
PK cPQ7to src/bootstrap.phpnu ٘ 'modules/{$vendor}-{$name}/',
'theme' => 'themes/{$vendor}-{$name}/'
);
}
PK cPQ! + src/Composer/Installers/MoodleInstaller.phpnu ٘ 'mod/{$name}/',
'admin_report' => 'admin/report/{$name}/',
'atto' => 'lib/editor/atto/plugins/{$name}/',
'tool' => 'admin/tool/{$name}/',
'assignment' => 'mod/assignment/type/{$name}/',
'assignsubmission' => 'mod/assign/submission/{$name}/',
'assignfeedback' => 'mod/assign/feedback/{$name}/',
'auth' => 'auth/{$name}/',
'availability' => 'availability/condition/{$name}/',
'block' => 'blocks/{$name}/',
'booktool' => 'mod/book/tool/{$name}/',
'cachestore' => 'cache/stores/{$name}/',
'cachelock' => 'cache/locks/{$name}/',
'calendartype' => 'calendar/type/{$name}/',
'format' => 'course/format/{$name}/',
'coursereport' => 'course/report/{$name}/',
'customcertelement' => 'mod/customcert/element/{$name}/',
'datafield' => 'mod/data/field/{$name}/',
'datapreset' => 'mod/data/preset/{$name}/',
'editor' => 'lib/editor/{$name}/',
'enrol' => 'enrol/{$name}/',
'filter' => 'filter/{$name}/',
'gradeexport' => 'grade/export/{$name}/',
'gradeimport' => 'grade/import/{$name}/',
'gradereport' => 'grade/report/{$name}/',
'gradingform' => 'grade/grading/form/{$name}/',
'local' => 'local/{$name}/',
'logstore' => 'admin/tool/log/store/{$name}/',
'ltisource' => 'mod/lti/source/{$name}/',
'ltiservice' => 'mod/lti/service/{$name}/',
'message' => 'message/output/{$name}/',
'mnetservice' => 'mnet/service/{$name}/',
'plagiarism' => 'plagiarism/{$name}/',
'portfolio' => 'portfolio/{$name}/',
'qbehaviour' => 'question/behaviour/{$name}/',
'qformat' => 'question/format/{$name}/',
'qtype' => 'question/type/{$name}/',
'quizaccess' => 'mod/quiz/accessrule/{$name}/',
'quiz' => 'mod/quiz/report/{$name}/',
'report' => 'report/{$name}/',
'repository' => 'repository/{$name}/',
'scormreport' => 'mod/scorm/report/{$name}/',
'search' => 'search/engine/{$name}/',
'theme' => 'theme/{$name}/',
'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
'profilefield' => 'user/profile/field/{$name}/',
'webservice' => 'webservice/{$name}/',
'workshopallocation' => 'mod/workshop/allocation/{$name}/',
'workshopeval' => 'mod/workshop/eval/{$name}/',
'workshopform' => 'mod/workshop/form/{$name}/'
);
}
PK cPQ]h ) src/Composer/Installers/ZendInstaller.phpnu ٘ 'library/{$name}/',
'extra' => 'extras/library/{$name}/',
'module' => 'module/{$name}/',
);
}
PK cPQM ( src/Composer/Installers/TaoInstaller.phpnu ٘ '{$name}'
);
public function inflectPackageVars($vars)
{
$extra = $this->package->getExtra();
if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
$vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
return $vars;
}
$vars['name'] = str_replace('extension-', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));
return $vars;
}
}
PK cPQ ) src/Composer/Installers/MayaInstaller.phpnu ٘ 'modules/{$name}/',
);
/**
* Format package name.
*
* For package type maya-module, cut off a trailing '-module' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'maya-module') {
return $this->inflectModuleVars($vars);
}
return $vars;
}
protected function inflectModuleVars($vars)
{
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQjn n . src/Composer/Installers/Concrete5Installer.phpnu ٘ 'concrete/',
'block' => 'application/blocks/{$name}/',
'package' => 'packages/{$name}/',
'theme' => 'application/themes/{$name}/',
'update' => 'updates/{$name}/',
);
}
PK cPQ>H - src/Composer/Installers/LavaLiteInstaller.phpnu ٘ 'packages/{$vendor}/{$name}/',
'theme' => 'public/themes/{$name}/',
);
}
PK cPQ 1 8 src/Composer/Installers/LanManagementSystemInstaller.phpnu ٘ 'plugins/{$name}/',
'template' => 'templates/{$name}/',
'document-template' => 'documents/templates/{$name}/',
'userpanel-module' => 'userpanel/modules/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQy* , src/Composer/Installers/FuelphpInstaller.phpnu ٘ 'components/{$name}/',
);
}
PK cPQږ + src/Composer/Installers/SyliusInstaller.phpnu ٘ 'themes/{$name}/',
);
}
PK cPQ_ , src/Composer/Installers/CiviCrmInstaller.phpnu ٘ 'ext/{$name}/'
);
}
PK cPQO + src/Composer/Installers/PuppetInstaller.phpnu ٘ 'modules/{$name}/',
);
}
PK cPQ6B ) src/Composer/Installers/ItopInstaller.phpnu ٘ 'extensions/{$name}/',
);
}
PK cPQ , src/Composer/Installers/ReIndexInstaller.phpnu ٘ 'themes/{$name}/',
'plugin' => 'plugins/{$name}/'
);
}
PK cPQh0 , src/Composer/Installers/PimcoreInstaller.phpnu ٘ 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQ/J 6 src/Composer/Installers/ClanCatsFrameworkInstaller.phpnu ٘ 'CCF/orbit/{$name}/',
'theme' => 'CCF/app/themes/{$name}/',
);
}PK cPQˇ .U U + src/Composer/Installers/MauticInstaller.phpnu ٘ 'plugins/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format package name of mautic-plugins to CamelCase
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] == 'mautic-plugin') {
$vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, ucfirst($vars['name']));
}
return $vars;
}
}
PK cPQg i * src/Composer/Installers/PiwikInstaller.phpnu ٘ 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
* @param array $vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQ?`7 , src/Composer/Installers/DecibelInstaller.phpnu ٘ 'app/{$name}/',
);
}
PK cPQ= / src/Composer/Installers/MicroweberInstaller.phpnu ٘ 'userfiles/modules/{$install_item_dir}/',
'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
'template' => 'userfiles/templates/{$install_item_dir}/',
'element' => 'userfiles/elements/{$install_item_dir}/',
'vendor' => 'vendor/{$install_item_dir}/',
'components' => 'components/{$install_item_dir}/'
);
/**
* Format package name.
*
* For package type microweber-module, cut off a trailing '-module' if present
*
* For package type microweber-template, cut off a trailing '-template' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($this->package->getTargetDir()) {
$vars['install_item_dir'] = $this->package->getTargetDir();
} else {
$vars['install_item_dir'] = $vars['name'];
if ($vars['type'] === 'microweber-template') {
return $this->inflectTemplateVars($vars);
}
if ($vars['type'] === 'microweber-templates') {
return $this->inflectTemplatesVars($vars);
}
if ($vars['type'] === 'microweber-core') {
return $this->inflectCoreVars($vars);
}
if ($vars['type'] === 'microweber-adapter') {
return $this->inflectCoreVars($vars);
}
if ($vars['type'] === 'microweber-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'microweber-modules') {
return $this->inflectModulesVars($vars);
}
if ($vars['type'] === 'microweber-skin') {
return $this->inflectSkinVars($vars);
}
if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
return $this->inflectElementVars($vars);
}
}
return $vars;
}
protected function inflectTemplateVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);
return $vars;
}
protected function inflectTemplatesVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);
return $vars;
}
protected function inflectCoreVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);
return $vars;
}
protected function inflectModuleVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);
return $vars;
}
protected function inflectModulesVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);
return $vars;
}
protected function inflectSkinVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);
return $vars;
}
protected function inflectElementVars($vars)
{
$vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);
return $vars;
}
}
PK cPQ@я1 1 , src/Composer/Installers/EliasisInstaller.phpnu ٘ 'components/{$name}/',
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$name}/',
'template' => 'templates/{$name}/',
);
}
PK cPQ? ) src/Composer/Installers/MakoInstaller.phpnu ٘ 'app/packages/{$name}/',
);
}
PK cPQ7 / src/Composer/Installers/SiteDirectInstaller.phpnu ٘ 'modules/{$vendor}/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/'
);
public function inflectPackageVars($vars)
{
return $this->parseVars($vars);
}
protected function parseVars($vars)
{
$vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQ - src/Composer/Installers/DokuWikiInstaller.phpnu ٘ 'lib/plugins/{$name}/',
'template' => 'lib/tpl/{$name}/',
);
/**
* Format package name.
*
* For package type dokuwiki-plugin, cut off a trailing '-plugin',
* or leading dokuwiki_ if present.
*
* For package type dokuwiki-template, cut off a trailing '-template' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'dokuwiki-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'dokuwiki-template') {
return $this->inflectTemplateVars($vars);
}
return $vars;
}
protected function inflectPluginVars($vars)
{
$vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
$vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
return $vars;
}
protected function inflectTemplateVars($vars)
{
$vars['name'] = preg_replace('/-template$/', '', $vars['name']);
$vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
return $vars;
}
}
PK cPQ84 ( src/Composer/Installers/SMFInstaller.phpnu ٘ 'Sources/{$name}/',
'theme' => 'Themes/{$name}/',
);
}
PK cPQ|X]D . src/Composer/Installers/RoundcubeInstaller.phpnu ٘ 'plugins/{$name}/',
);
/**
* Lowercase name and changes the name to a underscores
*
* @param array $vars
* @return array
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
return $vars;
}
}
PK cPQW& & * src/Composer/Installers/CraftInstaller.phpnu ٘ 'craft/plugins/{$name}/',
);
/**
* Strip `craft-` prefix and/or `-plugin` suffix from package names
*
* @param array $vars
*
* @return array
*/
final public function inflectPackageVars($vars)
{
return $this->inflectPluginVars($vars);
}
private function inflectPluginVars($vars)
{
$vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
$vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);
return $vars;
}
}
PK cPQb| 2 src/Composer/Installers/PlentymarketsInstaller.phpnu ٘ '{$name}/'
);
/**
* Remove hyphen, "plugin" and format to camelcase
* @param array $vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
$vars['name'] = explode("-", $vars['name']);
foreach ($vars['name'] as $key => $name) {
$vars['name'][$key] = ucfirst($vars['name'][$key]);
if (strcasecmp($name, "Plugin") == 0) {
unset($vars['name'][$key]);
}
}
$vars['name'] = implode("",$vars['name']);
return $vars;
}
}
PK cPQlκT T . src/Composer/Installers/WordPressInstaller.phpnu ٘ 'wp-content/plugins/{$name}/',
'theme' => 'wp-content/themes/{$name}/',
'muplugin' => 'wp-content/mu-plugins/{$name}/',
'dropin' => 'wp-content/{$name}/',
);
}
PK cPQidΦ * src/Composer/Installers/YawikInstaller.phpnu ٘ 'module/{$name}/',
);
/**
* Format package name to CamelCase
* @param array $vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}PK cPQ / src/Composer/Installers/PrestashopInstaller.phpnu ٘ 'modules/{$name}/',
'theme' => 'themes/{$name}/',
);
}
PK cPQKB,c c + src/Composer/Installers/DrupalInstaller.phpnu ٘ 'core/',
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
'library' => 'libraries/{$name}/',
'profile' => 'profiles/{$name}/',
'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
'drush' => 'drush/{$name}/',
'custom-theme' => 'themes/custom/{$name}/',
'custom-module' => 'modules/custom/{$name}/',
'custom-profile' => 'profiles/custom/{$name}/',
'drupal-multisite' => 'sites/{$name}/',
'console' => 'console/{$name}/',
'console-language' => 'console/language/{$name}/',
'config' => 'config/sync/',
);
}
PK cPQfn n - src/Composer/Installers/ShopwareInstaller.phpnu ٘ 'engine/Shopware/Plugins/Local/Backend/{$name}/',
'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
'theme' => 'templates/{$name}/',
'plugin' => 'custom/plugins/{$name}/',
'frontend-theme' => 'themes/Frontend/{$name}/',
);
/**
* Transforms the names
* @param array $vars
* @return array
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'shopware-theme') {
return $this->correctThemeName($vars);
}
return $this->correctPluginName($vars);
}
/**
* Changes the name to a camelcased combination of vendor and name
* @param array $vars
* @return array
*/
private function correctPluginName($vars)
{
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
$vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
return $vars;
}
/**
* Changes the name to a underscore separated name
* @param array $vars
* @return array
*/
private function correctThemeName($vars)
{
$vars['name'] = str_replace('-', '_', $vars['name']);
return $vars;
}
}
PK cPQ2 * src/Composer/Installers/PortoInstaller.phpnu ٘ 'app/Containers/{$name}/',
);
}
PK cPQLF F * src/Composer/Installers/WHMCSInstaller.phpnu ٘ 'modules/addons/{$vendor}_{$name}/',
'fraud' => 'modules/fraud/{$vendor}_{$name}/',
'gateways' => 'modules/gateways/{$vendor}_{$name}/',
'notifications' => 'modules/notifications/{$vendor}_{$name}/',
'registrars' => 'modules/registrars/{$vendor}_{$name}/',
'reports' => 'modules/reports/{$vendor}_{$name}/',
'security' => 'modules/security/{$vendor}_{$name}/',
'servers' => 'modules/servers/{$vendor}_{$name}/',
'social' => 'modules/social/{$vendor}_{$name}/',
'support' => 'modules/support/{$vendor}_{$name}/',
'templates' => 'templates/{$vendor}_{$name}/',
'includes' => 'includes/{$vendor}_{$name}/'
);
}
PK cPQNn3 , src/Composer/Installers/LaravelInstaller.phpnu ٘ 'libraries/{$name}/',
);
}
PK cPQ( + src/Composer/Installers/TheliaInstaller.phpnu ٘ 'local/modules/{$name}/',
'frontoffice-template' => 'templates/frontOffice/{$name}/',
'backoffice-template' => 'templates/backOffice/{$name}/',
'email-template' => 'templates/email/{$name}/',
);
}
PK cPQɽ] ) src/Composer/Installers/ChefInstaller.phpnu ٘ 'Chef/{$vendor}/{$name}/',
'role' => 'Chef/roles/{$name}/',
);
}
PK cPQ*p ) src/Composer/Installers/ElggInstaller.phpnu ٘ 'mod/{$name}/',
);
}
PK cPQ0nb b - src/Composer/Installers/DolibarrInstaller.phpnu ٘
*/
class DolibarrInstaller extends BaseInstaller
{
//TODO: Add support for scripts and themes
protected $locations = array(
'module' => 'htdocs/custom/{$name}/',
);
}
PK cPQ8} } - src/Composer/Installers/TYPO3CmsInstaller.phpnu ٘
*/
class TYPO3CmsInstaller extends BaseInstaller
{
protected $locations = array(
'extension' => 'typo3conf/ext/{$name}/',
);
}
PK cPQG * src/Composer/Installers/KirbyInstaller.phpnu ٘ 'site/plugins/{$name}/',
'field' => 'site/fields/{$name}/',
'tag' => 'site/tags/{$name}/'
);
}
PK cPQ2 0 src/Composer/Installers/AnnotateCmsInstaller.phpnu ٘ 'addons/modules/{$name}/',
'component' => 'addons/components/{$name}/',
'service' => 'addons/services/{$name}/',
);
}
PK cPQ!u\ - src/Composer/Installers/BonefishInstaller.phpnu ٘ 'Packages/{$vendor}/{$name}/'
);
}
PK cPQNÄ + src/Composer/Installers/KohanaInstaller.phpnu ٘ 'modules/{$name}/',
);
}
PK cPQP7B B + src/Composer/Installers/MajimaInstaller.phpnu ٘ 'plugins/{$name}/',
);
/**
* Transforms the names
* @param array $vars
* @return array
*/
public function inflectPackageVars($vars)
{
return $this->correctPluginName($vars);
}
/**
* Change hyphenated names to camelcase
* @param array $vars
* @return array
*/
private function correctPluginName($vars)
{
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
$vars['name'] = ucfirst($camelCasedName);
return $vars;
}
}
PK cPQA> 1 src/Composer/Installers/UserFrostingInstaller.phpnu ٘ 'app/sprinkles/{$name}/',
);
}
PK cPQ۳' ' , src/Composer/Installers/OsclassInstaller.phpnu ٘ 'oc-content/plugins/{$name}/',
'theme' => 'oc-content/themes/{$name}/',
'language' => 'oc-content/languages/{$name}/',
);
}
PK cPQk + src/Composer/Installers/RedaxoInstaller.phpnu ٘ 'redaxo/include/addons/{$name}/',
'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
);
}
PK cPQt , src/Composer/Installers/VanillaInstaller.phpnu ٘ 'plugins/{$name}/',
'theme' => 'themes/{$name}/',
);
}
PK cPQ:T6 / src/Composer/Installers/EzPlatformInstaller.phpnu ٘ 'web/assets/ezplatform/',
'assets' => 'web/assets/ezplatform/{$name}/',
);
}
PK cPQ"wس + src/Composer/Installers/DframeInstaller.phpnu ٘ 'modules/{$vendor}/{$name}/',
);
}
PK cPQy( ( % src/Composer/Installers/Installer.phpnu ٘ 'AimeosInstaller',
'asgard' => 'AsgardInstaller',
'attogram' => 'AttogramInstaller',
'agl' => 'AglInstaller',
'annotatecms' => 'AnnotateCmsInstaller',
'bitrix' => 'BitrixInstaller',
'bonefish' => 'BonefishInstaller',
'cakephp' => 'CakePHPInstaller',
'chef' => 'ChefInstaller',
'civicrm' => 'CiviCrmInstaller',
'ccframework' => 'ClanCatsFrameworkInstaller',
'cockpit' => 'CockpitInstaller',
'codeigniter' => 'CodeIgniterInstaller',
'concrete5' => 'Concrete5Installer',
'craft' => 'CraftInstaller',
'croogo' => 'CroogoInstaller',
'dframe' => 'DframeInstaller',
'dokuwiki' => 'DokuWikiInstaller',
'dolibarr' => 'DolibarrInstaller',
'decibel' => 'DecibelInstaller',
'drupal' => 'DrupalInstaller',
'elgg' => 'ElggInstaller',
'eliasis' => 'EliasisInstaller',
'ee3' => 'ExpressionEngineInstaller',
'ee2' => 'ExpressionEngineInstaller',
'ezplatform' => 'EzPlatformInstaller',
'fuel' => 'FuelInstaller',
'fuelphp' => 'FuelphpInstaller',
'grav' => 'GravInstaller',
'hurad' => 'HuradInstaller',
'imagecms' => 'ImageCMSInstaller',
'itop' => 'ItopInstaller',
'joomla' => 'JoomlaInstaller',
'kanboard' => 'KanboardInstaller',
'kirby' => 'KirbyInstaller',
'known' => 'KnownInstaller',
'kodicms' => 'KodiCMSInstaller',
'kohana' => 'KohanaInstaller',
'lms' => 'LanManagementSystemInstaller',
'laravel' => 'LaravelInstaller',
'lavalite' => 'LavaLiteInstaller',
'lithium' => 'LithiumInstaller',
'magento' => 'MagentoInstaller',
'majima' => 'MajimaInstaller',
'mantisbt' => 'MantisBTInstaller',
'mako' => 'MakoInstaller',
'maya' => 'MayaInstaller',
'mautic' => 'MauticInstaller',
'mediawiki' => 'MediaWikiInstaller',
'microweber' => 'MicroweberInstaller',
'modulework' => 'MODULEWorkInstaller',
'modx' => 'ModxInstaller',
'modxevo' => 'MODXEvoInstaller',
'moodle' => 'MoodleInstaller',
'october' => 'OctoberInstaller',
'ontowiki' => 'OntoWikiInstaller',
'oxid' => 'OxidInstaller',
'osclass' => 'OsclassInstaller',
'pxcms' => 'PxcmsInstaller',
'phpbb' => 'PhpBBInstaller',
'pimcore' => 'PimcoreInstaller',
'piwik' => 'PiwikInstaller',
'plentymarkets'=> 'PlentymarketsInstaller',
'ppi' => 'PPIInstaller',
'puppet' => 'PuppetInstaller',
'radphp' => 'RadPHPInstaller',
'phifty' => 'PhiftyInstaller',
'porto' => 'PortoInstaller',
'redaxo' => 'RedaxoInstaller',
'redaxo5' => 'Redaxo5Installer',
'reindex' => 'ReIndexInstaller',
'roundcube' => 'RoundcubeInstaller',
'shopware' => 'ShopwareInstaller',
'sitedirect' => 'SiteDirectInstaller',
'silverstripe' => 'SilverStripeInstaller',
'smf' => 'SMFInstaller',
'sydes' => 'SyDESInstaller',
'sylius' => 'SyliusInstaller',
'symfony1' => 'Symfony1Installer',
'tao' => 'TaoInstaller',
'thelia' => 'TheliaInstaller',
'tusk' => 'TuskInstaller',
'typo3-cms' => 'TYPO3CmsInstaller',
'typo3-flow' => 'TYPO3FlowInstaller',
'userfrosting' => 'UserFrostingInstaller',
'vanilla' => 'VanillaInstaller',
'whmcs' => 'WHMCSInstaller',
'wolfcms' => 'WolfCMSInstaller',
'wordpress' => 'WordPressInstaller',
'yawik' => 'YawikInstaller',
'zend' => 'ZendInstaller',
'zikula' => 'ZikulaInstaller',
'prestashop' => 'PrestashopInstaller'
);
/**
* Installer constructor.
*
* Disables installers specified in main composer extra installer-disable
* list
*
* @param IOInterface $io
* @param Composer $composer
* @param string $type
* @param Filesystem|null $filesystem
* @param BinaryInstaller|null $binaryInstaller
*/
public function __construct(
IOInterface $io,
Composer $composer,
$type = 'library',
Filesystem $filesystem = null,
BinaryInstaller $binaryInstaller = null
) {
parent::__construct($io, $composer, $type, $filesystem,
$binaryInstaller);
$this->removeDisabledInstallers();
}
/**
* {@inheritDoc}
*/
public function getInstallPath(PackageInterface $package)
{
$type = $package->getType();
$frameworkType = $this->findFrameworkType($type);
if ($frameworkType === false) {
throw new \InvalidArgumentException(
'Sorry the package type of this package is not yet supported.'
);
}
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
$installer = new $class($package, $this->composer, $this->getIO());
return $installer->getInstallPath($package, $frameworkType);
}
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$installPath = $this->getPackageBasePath($package);
$io = $this->io;
$outputStatus = function () use ($io, $installPath) {
$io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? 'deleted' : 'not deleted'));
};
$promise = parent::uninstall($repo, $package);
// Composer v2 might return a promise here
if ($promise instanceof PromiseInterface) {
return $promise->then($outputStatus);
}
// If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
$outputStatus();
}
/**
* {@inheritDoc}
*/
public function supports($packageType)
{
$frameworkType = $this->findFrameworkType($packageType);
if ($frameworkType === false) {
return false;
}
$locationPattern = $this->getLocationPattern($frameworkType);
return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
}
/**
* Finds a supported framework type if it exists and returns it
*
* @param string $type
* @return string
*/
protected function findFrameworkType($type)
{
$frameworkType = false;
krsort($this->supportedTypes);
foreach ($this->supportedTypes as $key => $val) {
if ($key === substr($type, 0, strlen($key))) {
$frameworkType = substr($type, 0, strlen($key));
break;
}
}
return $frameworkType;
}
/**
* Get the second part of the regular expression to check for support of a
* package type
*
* @param string $frameworkType
* @return string
*/
protected function getLocationPattern($frameworkType)
{
$pattern = false;
if (!empty($this->supportedTypes[$frameworkType])) {
$frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
/** @var BaseInstaller $framework */
$framework = new $frameworkClass(null, $this->composer, $this->getIO());
$locations = array_keys($framework->getLocations());
$pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
}
return $pattern ? : '(\w+)';
}
/**
* Get I/O object
*
* @return IOInterface
*/
private function getIO()
{
return $this->io;
}
/**
* Look for installers set to be disabled in composer's extra config and
* remove them from the list of supported installers.
*
* Globals:
* - true, "all", and "*" - disable all installers.
* - false - enable all installers (useful with
* wikimedia/composer-merge-plugin or similar)
*
* @return void
*/
protected function removeDisabledInstallers()
{
$extra = $this->composer->getPackage()->getExtra();
if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
// No installers are disabled
return;
}
// Get installers to disable
$disable = $extra['installer-disable'];
// Ensure $disabled is an array
if (!is_array($disable)) {
$disable = array($disable);
}
// Check which installers should be disabled
$all = array(true, "all", "*");
$intersect = array_intersect($all, $disable);
if (!empty($intersect)) {
// Disable all installers
$this->supportedTypes = array();
} else {
// Disable specified installers
foreach ($disable as $key => $installer) {
if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
unset($this->supportedTypes[$installer]);
}
}
}
}
}
PK cPQW W 1 src/Composer/Installers/SilverStripeInstaller.phpnu ٘ '{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Return the install path based on package type.
*
* Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
* must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
*
* @param PackageInterface $package
* @param string $frameworkType
* @return string
*/
public function getInstallPath(PackageInterface $package, $frameworkType = '')
{
if (
$package->getName() == 'silverstripe/framework'
&& preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
&& version_compare($package->getVersion(), '2.999.999') < 0
) {
return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
}
return parent::getInstallPath($package, $frameworkType);
}
}
PK cPQ̞f ) src/Composer/Installers/OxidInstaller.phpnu ٘ .+)\/.+/';
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'application/views/{$name}/',
'out' => 'out/{$name}/',
);
/**
* getInstallPath
*
* @param PackageInterface $package
* @param string $frameworkType
* @return void
*/
public function getInstallPath(PackageInterface $package, $frameworkType = '')
{
$installPath = parent::getInstallPath($package, $frameworkType);
$type = $this->package->getType();
if ($type === 'oxid-module') {
$this->prepareVendorDirectory($installPath);
}
return $installPath;
}
/**
* prepareVendorDirectory
*
* Makes sure there is a vendormetadata.php file inside
* the vendor folder if there is a vendor folder.
*
* @param string $installPath
* @return void
*/
protected function prepareVendorDirectory($installPath)
{
$matches = '';
$hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
if (!$hasVendorDirectory) {
return;
}
$vendorDirectory = $matches['vendor'];
$vendorPath = getcwd() . '/modules/' . $vendorDirectory;
if (!file_exists($vendorPath)) {
mkdir($vendorPath, 0755, true);
}
$vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
touch($vendorMetaDataPath);
}
}
PK cPQwc ( src/Composer/Installers/AglInstaller.phpnu ٘ 'More/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
return strtoupper($matches[1]);
}, $vars['name']);
return $vars;
}
}
PK cPQBq + src/Composer/Installers/JoomlaInstaller.phpnu ٘ 'components/{$name}/',
'module' => 'modules/{$name}/',
'template' => 'templates/{$name}/',
'plugin' => 'plugins/{$name}/',
'library' => 'libraries/{$name}/',
);
// TODO: Add inflector for mod_ and com_ names
}
PK cPQ]%: ) src/Composer/Installers/GravInstaller.phpnu ٘ 'user/plugins/{$name}/',
'theme' => 'user/themes/{$name}/',
);
/**
* Format package name
*
* @param array $vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
$restrictedWords = implode('|', array_keys($this->locations));
$vars['name'] = strtolower($vars['name']);
$vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
'$1',
$vars['name']
);
return $vars;
}
}
PK cPQÚ ) src/Composer/Installers/TuskInstaller.phpnu ٘
*/
class TuskInstaller extends BaseInstaller
{
protected $locations = array(
'task' => '.tusk/tasks/{$name}/',
'command' => '.tusk/commands/{$name}/',
'asset' => 'assets/tusk/{$name}/',
);
}
PK cPQE3 - src/Composer/Installers/OntoWikiInstaller.phpnu ٘ 'extensions/{$name}/',
'theme' => 'extensions/themes/{$name}/',
'translation' => 'extensions/translations/{$name}/',
);
/**
* Format package name to lower case and remove ".ontowiki" suffix
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower($vars['name']);
$vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
$vars['name'] = preg_replace('/-translation$/', '', $vars['name']);
return $vars;
}
}
PK cPQ
.. . + src/Composer/Installers/AsgardInstaller.phpnu ٘ 'Modules/{$name}/',
'theme' => 'Themes/{$name}/'
);
/**
* Format package name.
*
* For package type asgard-module, cut off a trailing '-plugin' if present.
*
* For package type asgard-theme, cut off a trailing '-theme' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'asgard-module') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'asgard-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
protected function inflectPluginVars($vars)
{
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
protected function inflectThemeVars($vars)
{
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQ) o , src/Composer/Installers/LithiumInstaller.phpnu ٘ 'libraries/{$name}/',
'source' => 'libraries/_source/{$name}/',
);
}
PK cPQMNY$ $ - src/Composer/Installers/ImageCMSInstaller.phpnu ٘ 'templates/{$name}/',
'module' => 'application/modules/{$name}/',
'library' => 'application/libraries/{$name}/',
);
}
PK cPQ' + src/Composer/Installers/AimeosInstaller.phpnu ٘ 'ext/{$name}/',
);
}
PK cPQ]wm6 6 - src/Composer/Installers/Symfony1Installer.phpnu ٘
*/
class Symfony1Installer extends BaseInstaller
{
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
return $vars;
}
}
PK cPQNd_ , src/Composer/Installers/OctoberInstaller.phpnu ٘ 'modules/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
);
/**
* Format package name.
*
* For package type october-plugin, cut off a trailing '-plugin' if present.
*
* For package type october-theme, cut off a trailing '-theme' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'october-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'october-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
protected function inflectPluginVars($vars)
{
$vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
$vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
protected function inflectThemeVars($vars)
{
$vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
return $vars;
}
}
PK cPQV , src/Composer/Installers/MagentoInstaller.phpnu ٘ 'app/design/frontend/{$name}/',
'skin' => 'skin/frontend/default/{$name}/',
'library' => 'lib/{$name}/',
);
}
PK cPQ ŭd d , src/Composer/Installers/CakePHPInstaller.phpnu ٘ 'Plugin/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
if ($this->matchesCakeVersion('>=', '3.0.0')) {
return $vars;
}
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
/**
* Change the default plugin location when cakephp >= 3.0
*/
public function getLocations()
{
if ($this->matchesCakeVersion('>=', '3.0.0')) {
$this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
}
return $this->locations;
}
/**
* Check if CakePHP version matches against a version
*
* @param string $matcher
* @param string $version
* @return bool
*/
protected function matchesCakeVersion($matcher, $version)
{
if (class_exists('Composer\Semver\Constraint\MultiConstraint')) {
$multiClass = 'Composer\Semver\Constraint\MultiConstraint';
$constraintClass = 'Composer\Semver\Constraint\Constraint';
} else {
$multiClass = 'Composer\Package\LinkConstraint\MultiConstraint';
$constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint';
}
$repositoryManager = $this->composer->getRepositoryManager();
if (! $repositoryManager) {
return false;
}
$repos = $repositoryManager->getLocalRepository();
if (!$repos) {
return false;
}
return $repos->findPackage('cakephp/cakephp', new $constraintClass($matcher, $version)) !== null;
}
}
PK cPQPb + src/Composer/Installers/RadPHPInstaller.phpnu ٘ 'src/{$name}/'
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
}
PK cPQYg; - src/Composer/Installers/AttogramInstaller.phpnu ٘ 'modules/{$name}/',
);
}
PK cPQU , src/Composer/Installers/MODXEvoInstaller.phpnu ٘ 'assets/snippets/{$name}/',
'plugin' => 'assets/plugins/{$name}/',
'module' => 'assets/modules/{$name}/',
'template' => 'assets/templates/{$name}/',
'lib' => 'assets/lib/{$name}/'
);
}
PK cPQx ) src/Composer/Installers/ModxInstaller.phpnu ٘ 'core/packages/{$name}/'
);
}
PK cPQWA5 5 0 src/Composer/Installers/CodeIgniterInstaller.phpnu ٘ 'application/libraries/{$name}/',
'third-party' => 'application/third_party/{$name}/',
'module' => 'application/modules/{$name}/',
);
}
PK cPQ " src/Composer/Installers/Plugin.phpnu ٘ installer = new Installer($io, $composer);
$composer->getInstallationManager()->addInstaller($this->installer);
}
public function deactivate(Composer $composer, IOInterface $io)
{
$composer->getInstallationManager()->removeInstaller($this->installer);
}
public function uninstall(Composer $composer, IOInterface $io)
{
}
}
PK cPQ9' ( src/Composer/Installers/PPIInstaller.phpnu ٘ 'modules/{$name}/',
);
}
PK cPQI0 * src/Composer/Installers/PhpBBInstaller.phpnu ٘ 'ext/{$vendor}/{$name}/',
'language' => 'language/{$name}/',
'style' => 'styles/{$name}/',
);
}
PK cPQYV / src/Composer/Installers/MODULEWorkInstaller.phpnu ٘ 'modules/{$name}/',
);
}
PK cPQf , src/Composer/Installers/WolfCMSInstaller.phpnu ٘ 'wolf/plugins/{$name}/',
);
}
PK cPQ * src/Composer/Installers/PxcmsInstaller.phpnu ٘ 'app/Modules/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format package name.
*
* @param array $vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'pxcms-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'pxcms-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* For package type pxcms-module, cut off a trailing '-plugin' if present.
*
* return string
*/
protected function inflectModuleVars($vars)
{
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
$vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
$vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
$vars['name'] = ucwords($vars['name']); // make module name camelcased
return $vars;
}
/**
* For package type pxcms-module, cut off a trailing '-plugin' if present.
*
* return string
*/
protected function inflectThemeVars($vars)
{
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
$vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
$vars['name'] = ucwords($vars['name']); // make module name camelcased
return $vars;
}
}
PK cPQ[ + src/Composer/Installers/CroogoInstaller.phpnu ٘ 'Plugin/{$name}/',
'theme' => 'View/Themed/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQEn , src/Composer/Installers/CockpitInstaller.phpnu ٘ 'cockpit/modules/addons/{$name}/',
);
/**
* Format module name.
*
* Strip `module-` prefix from package name.
*
* @param array @vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] == 'cockpit-module') {
return $this->inflectModuleVars($vars);
}
return $vars;
}
public function inflectModuleVars($vars)
{
$vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
return $vars;
}
}
PK cPQ3 + src/Composer/Installers/BitrixInstaller.phpnu ٘ .`.
* - `bitrix-d7-component` — copy the component to directory `bitrix/components//`.
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/_`.
*
* You can set custom path to directory with Bitrix kernel in `composer.json`:
*
* ```json
* {
* "extra": {
* "bitrix-dir": "s1/bitrix"
* }
* }
* ```
*
* @author Nik Samokhvalov
* @author Denis Kulichkin
*/
class BitrixInstaller extends BaseInstaller
{
protected $locations = array(
'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
);
/**
* @var array Storage for informations about duplicates at all the time of installation packages.
*/
private static $checkedDuplicates = array();
/**
* {@inheritdoc}
*/
public function inflectPackageVars($vars)
{
if ($this->composer->getPackage()) {
$extra = $this->composer->getPackage()->getExtra();
if (isset($extra['bitrix-dir'])) {
$vars['bitrix_dir'] = $extra['bitrix-dir'];
}
}
if (!isset($vars['bitrix_dir'])) {
$vars['bitrix_dir'] = 'bitrix';
}
return parent::inflectPackageVars($vars);
}
/**
* {@inheritdoc}
*/
protected function templatePath($path, array $vars = array())
{
$templatePath = parent::templatePath($path, $vars);
$this->checkDuplicates($templatePath, $vars);
return $templatePath;
}
/**
* Duplicates search packages.
*
* @param string $path
* @param array $vars
*/
protected function checkDuplicates($path, array $vars = array())
{
$packageType = substr($vars['type'], strlen('bitrix') + 1);
$localDir = explode('/', $vars['bitrix_dir']);
array_pop($localDir);
$localDir[] = 'local';
$localDir = implode('/', $localDir);
$oldPath = str_replace(
array('{$bitrix_dir}', '{$name}'),
array($localDir, $vars['name']),
$this->locations[$packageType]
);
if (in_array($oldPath, static::$checkedDuplicates)) {
return;
}
if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
$this->io->writeError(' Duplication of packages:');
$this->io->writeError(' Package ' . $oldPath . ' will be called instead package ' . $path . '');
while (true) {
switch ($this->io->ask(' Delete ' . $oldPath . ' [y,n,?]? ', '?')) {
case 'y':
$fs = new Filesystem();
$fs->removeDirectory($oldPath);
break 2;
case 'n':
break 2;
case '?':
default:
$this->io->writeError(array(
' y - delete package ' . $oldPath . ' and to continue with the installation',
' n - don\'t delete and to continue with the installation',
));
$this->io->writeError(' ? - print help');
break;
}
}
}
static::$checkedDuplicates[] = $oldPath;
}
}
PK cPQW[ , src/Composer/Installers/KodiCMSInstaller.phpnu ٘ 'cms/plugins/{$name}/',
'media' => 'cms/media/vendor/{$name}/'
);
}PK cPQ?t> ) src/Composer/Installers/FuelInstaller.phpnu ٘ 'fuel/app/modules/{$name}/',
'package' => 'fuel/packages/{$name}/',
'theme' => 'fuel/app/themes/{$name}/',
);
}
PK cPQd * src/Composer/Installers/KnownInstaller.phpnu ٘ 'IdnoPlugins/{$name}/',
'theme' => 'Themes/{$name}/',
'console' => 'ConsolePlugins/{$name}/',
);
}
PK cPQT * src/Composer/Installers/SyDESInstaller.phpnu ٘ 'app/modules/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format module name.
*
* Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
*
* @param array @vars
*
* @return array
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] == 'sydes-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'sydes-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
public function inflectModuleVars($vars)
{
$vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
protected function inflectThemeVars($vars)
{
$vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
$vars['name'] = strtolower($vars['name']);
return $vars;
}
}
PK cPQ * src/Composer/Installers/HuradInstaller.phpnu ٘ 'plugins/{$name}/',
'theme' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
}
PK cPQ2Q . src/Composer/Installers/MediaWikiInstaller.phpnu ٘ 'core/',
'extension' => 'extensions/{$name}/',
'skin' => 'skins/{$name}/',
);
/**
* Format package name.
*
* For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
* to CamelCase keeping existing uppercase chars.
*
* For package type mediawiki-skin, cut off a trailing '-skin' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'mediawiki-extension') {
return $this->inflectExtensionVars($vars);
}
if ($vars['type'] === 'mediawiki-skin') {
return $this->inflectSkinVars($vars);
}
return $vars;
}
protected function inflectExtensionVars($vars)
{
$vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
protected function inflectSkinVars($vars)
{
$vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
return $vars;
}
}
PK cPQ% % ) src/Composer/Installers/BaseInstaller.phpnu ٘ composer = $composer;
$this->package = $package;
$this->io = $io;
}
/**
* Return the install path based on package type.
*
* @param PackageInterface $package
* @param string $frameworkType
* @return string
*/
public function getInstallPath(PackageInterface $package, $frameworkType = '')
{
$type = $this->package->getType();
$prettyName = $this->package->getPrettyName();
if (strpos($prettyName, '/') !== false) {
list($vendor, $name) = explode('/', $prettyName);
} else {
$vendor = '';
$name = $prettyName;
}
$availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
$extra = $package->getExtra();
if (!empty($extra['installer-name'])) {
$availableVars['name'] = $extra['installer-name'];
}
if ($this->composer->getPackage()) {
$extra = $this->composer->getPackage()->getExtra();
if (!empty($extra['installer-paths'])) {
$customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
if ($customPath !== false) {
return $this->templatePath($customPath, $availableVars);
}
}
}
$packageType = substr($type, strlen($frameworkType) + 1);
$locations = $this->getLocations();
if (!isset($locations[$packageType])) {
throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
}
return $this->templatePath($locations[$packageType], $availableVars);
}
/**
* For an installer to override to modify the vars per installer.
*
* @param array $vars
* @return array
*/
public function inflectPackageVars($vars)
{
return $vars;
}
/**
* Gets the installer's locations
*
* @return array
*/
public function getLocations()
{
return $this->locations;
}
/**
* Replace vars in a path
*
* @param string $path
* @param array $vars
* @return string
*/
protected function templatePath($path, array $vars = array())
{
if (strpos($path, '{') !== false) {
extract($vars);
preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
if (!empty($matches[1])) {
foreach ($matches[1] as $var) {
$path = str_replace('{$' . $var . '}', $$var, $path);
}
}
}
return $path;
}
/**
* Search through a passed paths array for a custom install path.
*
* @param array $paths
* @param string $name
* @param string $type
* @param string $vendor = NULL
* @return string
*/
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
{
foreach ($paths as $path => $names) {
$names = (array) $names;
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
return $path;
}
}
return false;
}
}
PK cPQ . src/Composer/Installers/TYPO3FlowInstaller.phpnu ٘ 'Packages/Application/{$name}/',
'framework' => 'Packages/Framework/{$name}/',
'plugin' => 'Packages/Plugins/{$name}/',
'site' => 'Packages/Sites/{$name}/',
'boilerplate' => 'Packages/Boilerplates/{$name}/',
'build' => 'Build/{$name}/',
);
/**
* Modify the package name to be a TYPO3 Flow style key.
*
* @param array $vars
* @return array
*/
public function inflectPackageVars($vars)
{
$autoload = $this->package->getAutoload();
if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
$namespace = key($autoload['psr-0']);
$vars['name'] = str_replace('\\', '.', $namespace);
}
if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
$namespace = key($autoload['psr-4']);
$vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
}
return $vars;
}
}
PK cPQz , src/Composer/Installers/Redaxo5Installer.phpnu ٘ 'redaxo/src/addons/{$name}/',
'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
);
}
PK cPQ + src/Composer/Installers/PhiftyInstaller.phpnu ٘ 'bundles/{$name}/',
'library' => 'libraries/{$name}/',
'framework' => 'frameworks/{$name}/',
);
}
PK cPQmH H - src/Composer/Installers/MantisBTInstaller.phpnu ٘ 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQ,D( ( - src/Composer/Installers/KanboardInstaller.phpnu ٘ 'plugins/{$name}/',
);
}
PK cPQBgH 5 src/Composer/Installers/ExpressionEngineInstaller.phpnu ٘ 'system/expressionengine/third_party/{$name}/',
'theme' => 'themes/third_party/{$name}/',
);
private $ee3Locations = array(
'addon' => 'system/user/addons/{$name}/',
'theme' => 'themes/user/{$name}/',
);
public function getInstallPath(PackageInterface $package, $frameworkType = '')
{
$version = "{$frameworkType}Locations";
$this->locations = $this->$version;
return parent::getInstallPath($package, $frameworkType);
}
}
PK cPQC/ / * src/Composer/Installers/VgmcpInstaller.phpnu ٘ 'src/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
);
/**
* Format package name.
*
* For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
*
* For package type vgmcp-theme, cut off a trailing '-theme' if present.
*
*/
public function inflectPackageVars($vars)
{
if ($vars['type'] === 'vgmcp-bundle') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'vgmcp-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
protected function inflectPluginVars($vars)
{
$vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
protected function inflectThemeVars($vars)
{
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
PK cPQ_! ! .gitattributesnu ٘ * text=auto
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/_config.yml export-ignore
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/README.md export-ignore
PK cPQy phpunit.xml.distnu ٘
tests/Composer/Installers
src/Composer/Installers
PK cPQ
.editorconfignu ٘ ; top-most EditorConfig file
root = true
; Unix-style newlines
[*]
end_of_line = LF
[*.php]
indent_style = space
indent_size = 4
PK cPQƲ*n n CHANGELOG.mdnu ٘ # Change Log
## v1.9.0 - 2020-04-07
## Added
* Added support for Composer 2.0
* Added drupal-database-driver type to Drupal Framework, [#452](https://github.com/composer/installers/pull/452)
* Added support for declaring installer-paths values as strings [#449](https://github.com/composer/installers/pull/449)
## v1.8.0 - 2020-02-07
## Added
* Added support for MantisBT plugins, [#442](https://github.com/composer/installers/pull/442).
* Added drupal-config type to Drupal Framework, [#440](https://github.com/composer/installers/pull/440).
* Added support for Sylius themes, [#445](https://github.com/composer/installers/pull/445).
## v1.7.0 - 2019-08-12
## Added
* Added support for Redaxo v5, [#410](https://github.com/composer/installers/pull/410).
* Added TAO extensions installer, [#424](https://github.com/composer/installers/pull/424).
* Added Know installer, [#425](https://github.com/composer/installers/pull/425).
* Added support for Drupal Console custom packages and languages, [#311](https://github.com/composer/installers/pull/311).
* Added Drupal custom profile installation path, [#416](https://github.com/composer/installers/pull/416).
* Add support drupal-site type, [#417](https://github.com/composer/installers/pull/417).
* Added `customcertelement` for Moodle, [#408](https://github.com/composer/installers/pull/408).
* Added Dframe installer, [#404](https://github.com/composer/installers/pull/404).
* Added WHMCS installer, [#401](https://github.com/composer/installers/pull/401).
## Fixed
* Get `target-dir` from package attributes, [#432](https://github.com/composer/installers/pull/432).
## Deprecated
* Deprecated Pimcore installer, [#400](https://github.com/composer/installers/pull/400).
## v1.6.0 - 2018-09-12
## Added
* Added ability to disable all or certain installers, [#376](https://github.com/composer/installers/pull/376).
* Added MediaWiki Core, [#391](https://github.com/composer/installers/pull/391).
* Added CiviCrm installer, [#385](https://github.com/composer/installers/pull/385).
## Fixed
* Normalise vendor directory containing hyphen, [#397](https://github.com/composer/installers/pull/397).
## v1.5.0 - 2017-12-29
### Added
* Added WordPress dropin support.
* Added new types supported for Eliasis.
* Added support for Phoenix CMS.
* Added MODX installer.
* Added Majima instaler.
* Added SiteDirect installer.
* Added support optional prefix in OctoberCMS installers.
* Added PHP 7.2 support.
### Changed
* Changed remove packages, see [#348](https://github.com/composer/installers/pull/348).
### Fixed
* Fixed code style, removed unused imports.
## v1.4.0 - 2017-08-09
### Added
* Installer for eZ Platform.
* Installer for UserFrosting.
* Installer for Osclass.
* Installer for Lan Management System.
### Changed
* Added vendor name to package path for Lavalite.
## v1.3.0 - 2017-04-24
### Added
* Kanboard plugins installer.
* Porto-SAP installer.
* Add `core` to concrete5 installer.
* Support Moodle "search" plugin type.
* SyDES installer.
* iTop installer.
* Lavalite installer.
* Module type for Eliasis.
* Vgmcp installer.
* OntoWiki installer.
* The requirements for contributing (CONTRIBUTING.md).
## v1.2.0 - 2016-08-13
### Added
* Installer for Attogram.
* Installer for Cockpit.
* Installer for Plentymarkets.
* Installer for ReIndex.
* Installer for Vanilla.
* Installer for YAWIK.
* Added missing environments for new Shopware (5.2) Plugin System.
## v1.1.0 - 2016-07-05
### Added
* Installer for ReIndex.
* Installer for RadPHP.
* Installer for Decibel.
* Installer for Phifty.
* Installer for ExpressionEngine.
### Changed
* New paths for new Bitrix CMS. Old paths is deprecated.
### Deprecated
* Old paths in Bitrix CMS Installer is deprecated.
## v1.0.25 - 2016-04-13
### Removed
* Revert TYPO3 installer deletion.
## v1.0.24 - 2016-04-05
### Added
* Installer for ImageCMS.
* Installer for Mautic.
* New types in the Kirby installer: `kirby-plugin` and `kirby-field`.
* New types in the Drupal installer: `custom-theme` and `custom-module`.
### Changed
* Switch to PSR-4.
* Update Bitrix Installer: configuration for setting custom path to directory with kernel.
### Removed
* Remove TYPO3 Extension installers.
PK cPQ
ho o tests/bootstrap.phpnu ٘ add('Composer\Installers\Test', __DIR__);
PK cPQ̀oW 5 tests/Composer/Installers/Test/YawikInstallerTest.phpnu ٘ package = new Package('YawikCompanyRegistration', '1.0', '1.0');
$this->io = $this->getMock('Composer\IO\PackageInterface');
$this->composer = new Composer();
}
/**
* testInflectPackageVars
*
* @dataProvider packageNameProvider
* @return void
*/
public function testInflectPackageVars($input)
{
$installer = new YawikInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => $input));
$this->assertEquals($result, array('name' => 'YawikCompanyRegistration'));
}
public function packageNameProvider()
{
return array(
array('yawik-company-registration'),
array('yawik_company_registration'),
array('YawikCompanyRegistration')
);
}
}
PK cPQ*+ + 5 tests/Composer/Installers/Test/VgmcpInstallerTest.phpnu ٘ installer = new VgmcpInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
array('name' => $expected, 'type' => $type),
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
);
}
public function packageNameInflectionProvider()
{
return array(
// Should keep bundle name StudlyCase
array(
'vgmcp-bundle',
'user-profile',
'UserProfile'
),
array(
'vgmcp-bundle',
'vgmcp-bundle',
'Vgmcp'
),
array(
'vgmcp-bundle',
'blog',
'Blog'
),
// tests that exactly one '-bundle' is cut off
array(
'vgmcp-bundle',
'some-bundle-bundle',
'SomeBundle',
),
// tests that exactly one '-theme' is cut off
array(
'vgmcp-theme',
'some-theme-theme',
'SomeTheme',
),
// tests that names without '-theme' suffix stay valid
array(
'vgmcp-theme',
'someothertheme',
'Someothertheme',
),
// Should keep theme name StudlyCase
array(
'vgmcp-theme',
'adminlte-advanced',
'AdminlteAdvanced'
),
);
}
}
PK cPQ>g 7 tests/Composer/Installers/Test/OctoberInstallerTest.phpnu ٘ installer = new OctoberInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $vendor, $name, $expectedVendor, $expectedName)
{
$this->assertEquals(
$this->installer->inflectPackageVars(array(
'vendor' => $vendor,
'name' => $name,
'type' => $type
)),
array('vendor' => $expectedVendor, 'name' => $expectedName, 'type' => $type)
);
}
public function packageNameInflectionProvider()
{
return array(
array(
'october-plugin',
'acme',
'subpagelist',
'acme',
'subpagelist',
),
array(
'october-plugin',
'acme',
'subpagelist-plugin',
'acme',
'subpagelist',
),
array(
'october-plugin',
'acme',
'semanticoctober',
'acme',
'semanticoctober',
),
// tests vendor name containing a hyphen
array(
'october-plugin',
'foo-bar-co',
'blog',
'foobarco',
'blog'
),
// tests that exactly one '-theme' is cut off
array(
'october-theme',
'acme',
'some-theme-theme',
'acme',
'some-theme',
),
// tests that names without '-theme' suffix stay valid
array(
'october-theme',
'acme',
'someothertheme',
'acme',
'someothertheme',
),
);
}
}
PK cPQ 9 tests/Composer/Installers/Test/MediaWikiInstallerTest.phpnu ٘ installer = new MediaWikiInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
$this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
array('name' => $expected, 'type'=>$type)
);
}
public function packageNameInflectionProvider()
{
return array(
array(
'mediawiki-extension',
'sub-page-list',
'SubPageList',
),
array(
'mediawiki-extension',
'sub-page-list-extension',
'SubPageList',
),
array(
'mediawiki-extension',
'semantic-mediawiki',
'SemanticMediawiki',
),
// tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions
array(
'mediawiki-skin',
'some-skin-skin',
'some-skin',
),
// tests that names without '-skin' suffix stay valid
array(
'mediawiki-skin',
'someotherskin',
'someotherskin',
),
);
}
}
PK cPQ96 8 tests/Composer/Installers/Test/DokuWikiInstallerTest.phpnu ٘ installer = new DokuWikiInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
$this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
array('name' => $expected, 'type'=>$type)
);
}
public function packageNameInflectionProvider()
{
return array(
array(
'dokuwiki-plugin',
'dokuwiki-test-plugin',
'test',
),
array(
'dokuwiki-plugin',
'test-plugin',
'test',
),
array(
'dokuwiki-plugin',
'dokuwiki_test',
'test',
),
array(
'dokuwiki-plugin',
'test',
'test',
),
array(
'dokuwiki-plugin',
'test-template',
'test-template',
),
array(
'dokuwiki-template',
'dokuwiki-test-template',
'test',
),
array(
'dokuwiki-template',
'test-template',
'test',
),
array(
'dokuwiki-template',
'dokuwiki_test',
'test',
),
array(
'dokuwiki-template',
'test',
'test',
),
array(
'dokuwiki-template',
'test-plugin',
'test-plugin',
),
);
}
}
PK cPQ$ $ 6 tests/Composer/Installers/Test/AsgardInstallerTest.phpnu ٘ installer = new AsgardInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
array('name' => $expected, 'type' => $type),
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
);
}
public function packageNameInflectionProvider()
{
return array(
// Should keep module name StudlyCase
array(
'asgard-module',
'user-profile',
'UserProfile'
),
array(
'asgard-module',
'asgard-module',
'Asgard'
),
array(
'asgard-module',
'blog',
'Blog'
),
// tests that exactly one '-module' is cut off
array(
'asgard-module',
'some-module-module',
'SomeModule',
),
// tests that exactly one '-theme' is cut off
array(
'asgard-theme',
'some-theme-theme',
'SomeTheme',
),
// tests that names without '-theme' suffix stay valid
array(
'asgard-theme',
'someothertheme',
'Someothertheme',
),
// Should keep theme name StudlyCase
array(
'asgard-theme',
'adminlte-advanced',
'AdminlteAdvanced'
),
);
}
}
PK cPQ (p% % 7 tests/Composer/Installers/Test/PimcoreInstallerTest.phpnu ٘ package = new Package('CamelCased', '1.0', '1.0');
$this->io = $this->getMock('Composer\IO\PackageInterface');
$this->composer = new Composer();
}
/**
* testInflectPackageVars
*
* @return void
*/
public function testInflectPackageVars()
{
$installer = new PimcoreInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
$this->assertEquals($result, array('name' => 'CamelCased'));
$installer = new PimcoreInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'with-dash'));
$this->assertEquals($result, array('name' => 'WithDash'));
$installer = new PimcoreInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
$this->assertEquals($result, array('name' => 'WithUnderscore'));
}
}
PK cPQo#\ \ 7 tests/Composer/Installers/Test/CiviCrmInstallerTest.phpnu ٘ installer = new CiviCrmInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
array('name' => $expected, 'type' => $type),
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
);
}
public function packageNameInflectionProvider()
{
return array(
array(
'civicrm-ext',
'org.civicrm.shoreditch',
'org.civicrm.shoreditch'
),
array(
'civicrm-ext',
'org.civicrm.flexmailer',
'org.civicrm.flexmailer'
),
array(
'civicrm-ext',
'uk.co.vedaconsulting.mosaico',
'uk.co.vedaconsulting.mosaico'
)
);
}
}
PK cPQS S 7 tests/Composer/Installers/Test/CakePHPInstallerTest.phpnu ٘ package = new Package('CamelCased', '1.0', '1.0');
$this->io = $this->getMock('Composer\IO\PackageInterface');
$this->composer = new Composer();
$this->composer->setConfig(new Config(false));
}
/**
* testInflectPackageVars
*
* @return void
*/
public function testInflectPackageVars()
{
$installer = new CakePHPInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
$this->assertEquals($result, array('name' => 'CamelCased'));
$installer = new CakePHPInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'with-dash'));
$this->assertEquals($result, array('name' => 'WithDash'));
$installer = new CakePHPInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
$this->assertEquals($result, array('name' => 'WithUnderscore'));
$installer = new CakePHPInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'cake/acl'));
$this->assertEquals($result, array('name' => 'Cake/Acl'));
$installer = new CakePHPInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit'));
$this->assertEquals($result, array('name' => 'Cake/DebugKit'));
}
/**
* Test getLocations returning appropriate values based on CakePHP version
*
*/
public function testGetLocations() {
$package = new RootPackage('CamelCased', '1.0', '1.0');
$composer = $this->composer;
$io = $this->getMock('Composer\IO\IOInterface');
$config = $this->getMock('Composer\Config');
// Simultaneous support for Composer 1 and 2
$constructorArg3 = null;
$reflectorClass = new \ReflectionClass( '\Composer\Repository\RepositoryManager');
if ($reflectorClass->getConstructor()->getNumberOfRequiredParameters() == 3) {
$constructorArg3 = $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock();
}
$rm = new RepositoryManager(
$io,
$config,
$constructorArg3
);
$composer->setRepositoryManager($rm);
$installer = new CakePHPInstaller($package, $composer);
// 2.0 < cakephp < 3.0
$this->setCakephpVersion($rm, '2.0.0');
$result = $installer->getLocations();
$this->assertContains('Plugin/', $result['plugin']);
$this->setCakephpVersion($rm, '2.5.9');
$result = $installer->getLocations();
$this->assertContains('Plugin/', $result['plugin']);
$this->setCakephpVersion($rm, '~2.5');
$result = $installer->getLocations();
$this->assertContains('Plugin/', $result['plugin']);
$this->setCakephpVersion($rm, '>=2.5');
$result = $installer->getLocations();
$this->assertContains('Plugin/', $result['plugin']);
// cakephp >= 3.0
$this->setCakephpVersion($rm, '3.0.*-dev');
$result = $installer->getLocations();
$this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
$this->setCakephpVersion($rm, '~8.8');
$result = $installer->getLocations();
$this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
}
protected function setCakephpVersion($rm, $version) {
$parser = new VersionParser();
list(, $version) = explode(' ', $parser->parseConstraints($version));
$installed = new InstalledArrayRepository();
$package = new Package('cakephp/cakephp', $version, $version);
$installed->addPackage($package);
$rm->setLocalRepository($installed);
}
}
PK cPQ7D`x x 0 tests/Composer/Installers/Test/InstallerTest.phpnu ٘ fs = new Filesystem;
$this->composer = new Composer();
$this->config = new Config();
$this->composer->setConfig($this->config);
$this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
$this->ensureDirectoryExistsAndClear($this->vendorDir);
$this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
$this->ensureDirectoryExistsAndClear($this->binDir);
$this->config->merge(array(
'config' => array(
'vendor-dir' => $this->vendorDir,
'bin-dir' => $this->binDir,
),
));
$this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
->disableOriginalConstructor()
->getMock();
$this->composer->setDownloadManager($this->dm);
$this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
$this->io = $this->getMock('Composer\IO\IOInterface');
$consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
$this->composer->setPackage($consumerPackage);
}
/**
* tearDown
*
* @return void
*/
public function tearDown()
{
$this->fs->removeDirectory($this->vendorDir);
$this->fs->removeDirectory($this->binDir);
}
/**
* testSupports
*
* @return void
*
* @dataProvider dataForTestSupport
*/
public function testSupports($type, $expected)
{
$installer = new Installer($this->io, $this->composer);
$this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
}
/**
* dataForTestSupport
*/
public function dataForTestSupport()
{
return array(
array('agl-module', true),
array('aimeos-extension', true),
array('annotatecms-module', true),
array('annotatecms-component', true),
array('annotatecms-service', true),
array('attogram-module', true),
array('bitrix-module', true),
array('bitrix-component', true),
array('bitrix-theme', true),
array('bonefish-package', true),
array('cakephp', false),
array('cakephp-', false),
array('cakephp-app', false),
array('cakephp-plugin', true),
array('chef-cookbook', true),
array('chef-role', true),
array('cockpit-module', true),
array('codeigniter-app', false),
array('codeigniter-library', true),
array('codeigniter-third-party', true),
array('codeigniter-module', true),
array('concrete5-block', true),
array('concrete5-package', true),
array('concrete5-theme', true),
array('concrete5-core', true),
array('concrete5-update', true),
array('craft-plugin', true),
array('croogo-plugin', true),
array('croogo-theme', true),
array('decibel-app', true),
array('dframe-module', true),
array('dokuwiki-plugin', true),
array('dokuwiki-template', true),
array('drupal-core', true),
array('drupal-module', true),
array('drupal-theme', true),
array('drupal-library', true),
array('drupal-profile', true),
array('drupal-database-driver', true),
array('drupal-drush', true),
array('drupal-custom-theme', true),
array('drupal-custom-module', true),
array('drupal-custom-profile', true),
array('dolibarr-module', true),
array('ee3-theme', true),
array('ee3-addon', true),
array('ee2-theme', true),
array('ee2-addon', true),
array('elgg-plugin', true),
array('eliasis-component', true),
array('eliasis-module', true),
array('eliasis-plugin', true),
array('eliasis-template', true),
array('ezplatform-assets', true),
array('ezplatform-meta-assets', true),
array('fuel-module', true),
array('fuel-package', true),
array('fuel-theme', true),
array('fuelphp-component', true),
array('hurad-plugin', true),
array('hurad-theme', true),
array('imagecms-template', true),
array('imagecms-module', true),
array('imagecms-library', true),
array('itop-extension', true),
array('joomla-library', true),
array('kanboard-plugin', true),
array('kirby-plugin', true),
array('known-plugin', true),
array('known-theme', true),
array('known-console', true),
array('kohana-module', true),
array('lms-plugin', true),
array('lms-template', true),
array('lms-document-template', true),
array('lms-userpanel-module', true),
array('laravel-library', true),
array('lavalite-theme', true),
array('lavalite-package', true),
array('lithium-library', true),
array('magento-library', true),
array('majima-plugin', true),
array('mako-package', true),
array('mantisbt-plugin', true),
array('modx-extra', true),
array('modxevo-snippet', true),
array('modxevo-plugin', true),
array('modxevo-module', true),
array('modxevo-template', true),
array('modxevo-lib', true),
array('mediawiki-extension', true),
array('mediawiki-skin', true),
array('microweber-module', true),
array('modulework-module', true),
array('moodle-mod', true),
array('october-module', true),
array('october-plugin', true),
array('piwik-plugin', true),
array('pxcms-module', true),
array('pxcms-theme', true),
array('phpbb-extension', true),
array('pimcore-plugin', true),
array('plentymarkets-plugin', true),
array('ppi-module', true),
array('prestashop-module', true),
array('prestashop-theme', true),
array('puppet-module', true),
array('porto-container', true),
array('radphp-bundle', true),
array('redaxo-addon', true),
array('redaxo-bestyle-plugin', true),
array('redaxo5-addon', true),
array('redaxo5-bestyle-plugin', true),
array('reindex-theme', true),
array('reindex-plugin', true),
array('roundcube-plugin', true),
array('shopware-backend-plugin', true),
array('shopware-core-plugin', true),
array('shopware-frontend-plugin', true),
array('shopware-theme', true),
array('shopware-plugin', true),
array('shopware-frontend-theme', true),
array('silverstripe-module', true),
array('silverstripe-theme', true),
array('smf-module', true),
array('smf-theme', true),
array('sydes-module', true),
array('sydes-theme', true),
array('sylius-theme', true),
array('symfony1-plugin', true),
array('thelia-module', true),
array('thelia-frontoffice-template', true),
array('thelia-backoffice-template', true),
array('thelia-email-template', true),
array('tusk-task', true),
array('tusk-asset', true),
array('typo3-flow-plugin', true),
array('typo3-cms-extension', true),
array('userfrosting-sprinkle', true),
array('vanilla-plugin', true),
array('vanilla-theme', true),
array('whmcs-addons', true),
array('whmcs-fraud', true),
array('whmcs-gateways', true),
array('whmcs-notifications', true),
array('whmcs-registrars', true),
array('whmcs-reports', true),
array('whmcs-security', true),
array('whmcs-servers', true),
array('whmcs-social', true),
array('whmcs-support', true),
array('whmcs-templates', true),
array('whmcs-includes', true),
array('wolfcms-plugin', true),
array('wordpress-plugin', true),
array('wordpress-core', false),
array('yawik-module', true),
array('zend-library', true),
array('zikula-module', true),
array('zikula-theme', true),
array('kodicms-plugin', true),
array('kodicms-media', true),
array('phifty-bundle', true),
array('phifty-library', true),
array('phifty-framework', true),
array('osclass-plugin', true),
array('osclass-theme', true),
array('osclass-language', true),
);
}
/**
* testInstallPath
*
* @dataProvider dataForTestInstallPath
*/
public function testInstallPath($type, $path, $name, $version = '1.0.0')
{
$installer = new Installer($this->io, $this->composer);
$package = new Package($name, $version, $version);
$package->setType($type);
$result = $installer->getInstallPath($package);
$this->assertEquals($path, $result);
}
/**
* dataFormTestInstallPath
*/
public function dataForTestInstallPath()
{
return array(
array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
array('aimeos-extension', 'ext/ai-test/', 'author/ai-test'),
array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
array('attogram-module', 'modules/my_module/', 'author/my_module'),
array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),
array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),
array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),
array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),
array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
array('concrete5-block', 'application/blocks/concrete5_block/', 'remo/concrete5_block'),
array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
array('concrete5-theme', 'application/themes/concrete5_theme/', 'remo/concrete5_theme'),
array('concrete5-core', 'concrete/', 'concrete5/core'),
array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),
array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
array('decibel-app', 'app/someapp/', 'author/someapp'),
array('dframe-module', 'modules/author/mymodule/', 'author/mymodule'),
array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
array('drupal-core', 'core/', 'drupal/core'),
array('drupal-module', 'modules/my_module/', 'shama/my_module'),
array('drupal-theme', 'themes/my_theme/', 'shama/my_theme'),
array('drupal-library', 'libraries/my_library/', 'shama/my_library'),
array('drupal-profile', 'profiles/my_profile/', 'shama/my_profile'),
array('drupal-database-driver', 'drivers/lib/Drupal/Driver/Database/my_driver/', 'shama/my_driver'),
array('drupal-drush', 'drush/my_command/', 'shama/my_command'),
array('drupal-custom-theme', 'themes/custom/my_theme/', 'shama/my_theme'),
array('drupal-custom-module', 'modules/custom/my_module/', 'shama/my_module'),
array('drupal-custom-profile', 'profiles/custom/my_profile/', 'shama/my_profile'),
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
array('eliasis-component', 'components/my_component/', 'shama/my_component'),
array('eliasis-module', 'modules/my_module/', 'shama/my_module'),
array('eliasis-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
array('eliasis-template', 'templates/my_template/', 'shama/my_template'),
array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),
array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),
array('ezplatform-assets', 'web/assets/ezplatform/ezplatform_comp/', 'author/ezplatform_comp'),
array('ezplatform-meta-assets', 'web/assets/ezplatform/', 'author/ezplatform_comp'),
array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
array('imagecms-template', 'templates/my_template/', 'shama/my_template'),
array('imagecms-module', 'application/modules/my_module/', 'shama/my_module'),
array('imagecms-library', 'application/libraries/my_library/', 'shama/my_library'),
array('itop-extension', 'extensions/my_extension/', 'shama/my_extension'),
array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
array('kanboard-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
array('known-plugin', 'IdnoPlugins/SamplePlugin/', 'known/SamplePlugin'),
array('known-theme', 'Themes/SampleTheme/', 'known/SampleTheme'),
array('known-console', 'ConsolePlugins/SampleConsolePlugin/', 'known/SampleConsolePlugin'),
array('kohana-module', 'modules/my_package/', 'shama/my_package'),
array('lms-plugin', 'plugins/MyPackage/', 'shama/MyPackage'),
array('lms-plugin', 'plugins/MyPackage/', 'shama/my_package'),
array('lms-template', 'templates/MyPackage/', 'shama/MyPackage'),
array('lms-template', 'templates/MyPackage/', 'shama/my_package'),
array('lms-document-template', 'documents/templates/MyPackage/', 'shama/MyPackage'),
array('lms-document-template', 'documents/templates/MyPackage/', 'shama/my_package'),
array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/MyPackage'),
array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/my_package'),
array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
array('lavalite-theme', 'public/themes/my_theme/', 'shama/my_theme'),
array('lavalite-package', 'packages/my_group/my_package/', 'my_group/my_package'),
array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
array('magento-library', 'lib/foo/', 'test/foo'),
array('majima-plugin', 'plugins/MyPlugin/', 'shama/my-plugin'),
array('modx-extra', 'core/packages/extra/', 'vendor/extra'),
array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),
array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),
array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),
array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),
array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),
array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
array('mantisbt-plugin', 'plugins/MyPlugin/', 'shama/my_plugin'),
array('mediawiki-extension', 'extensions/APC/', 'author/APC'),
array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),
array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),
array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),
array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),
array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),
array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),
array('modulework-module', 'modules/my_package/', 'shama/my_package'),
array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),
array('pxcms-module', 'app/Modules/Foo/', 'vendor/module-foo'),
array('pxcms-module', 'app/Modules/Foo/', 'vendor/pxcms-foo'),
array('pxcms-theme', 'themes/Foo/', 'vendor/theme-foo'),
array('pxcms-theme', 'themes/Foo/', 'vendor/pxcms-foo'),
array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
array('phpbb-style', 'styles/foo/', 'test/foo'),
array('phpbb-language', 'language/foo/', 'test/foo'),
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
array('ppi-module', 'modules/foo/', 'test/foo'),
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
array('porto-container', 'app/Containers/container-name/', 'test/container-name'),
array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
array('redaxo5-addon', 'redaxo/src/addons/my_plugin/', 'shama/my_plugin'),
array('redaxo5-bestyle-plugin', 'redaxo/src/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
array('reindex-theme', 'themes/my_module/', 'author/my_module'),
array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),
array('roundcube-plugin', 'plugins/base/', 'test/base'),
array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),
array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),
array('silverstripe-module', 'my_module/', 'shama/my_module'),
array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
array('smf-module', 'Sources/my_module/', 'shama/my_module'),
array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),
array('sylius-theme', 'themes/my_theme/', 'shama/my_theme'),
array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),
array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),
array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),
array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),
array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),
array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
array('userfrosting-sprinkle', 'app/sprinkles/my_sprinkle/', 'shama/my_sprinkle'),
array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
array('whmcs-addons', 'modules/addons/vendor_addon_name/', 'vendor/addon_name'),
array('whmcs-fraud', 'modules/fraud/vendor_fraud_name/', 'vendor/fraud_name'),
array('whmcs-gateways', 'modules/gateways/vendor_gateway_name/', 'vendor/gateway_name'),
array('whmcs-notifications', 'modules/notifications/vendor_notification_name/', 'vendor/notification_name'),
array('whmcs-registrars', 'modules/registrars/vendor_registrar_name/', 'vendor/registrar_name'),
array('whmcs-reports', 'modules/reports/vendor_report_name/', 'vendor/report_name'),
array('whmcs-security', 'modules/security/vendor_security_name/', 'vendor/security_name'),
array('whmcs-servers', 'modules/servers/vendor_server_name/', 'vendor/server_name'),
array('whmcs-social', 'modules/social/vendor_social_name/', 'vendor/social_name'),
array('whmcs-support', 'modules/support/vendor_support_name/', 'vendor/support_name'),
array('whmcs-templates', 'templates/vendor_template_name/', 'vendor/template_name'),
array('whmcs-includes', 'includes/vendor_include_name/', 'vendor/include_name'),
array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
array('phifty-bundle', 'bundles/core/', 'shama/core'),
array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
array('yawik-module', 'module/MyModule/', 'shama/my_module'),
array('osclass-plugin', 'oc-content/plugins/sample_plugin/', 'test/sample_plugin'),
array('osclass-theme', 'oc-content/themes/sample_theme/', 'test/sample_theme'),
array('osclass-language', 'oc-content/languages/sample_lang/', 'test/sample_lang'),
);
}
/**
* testGetCakePHPInstallPathException
*
* @return void
*
* @expectedException \InvalidArgumentException
*/
public function testGetCakePHPInstallPathException()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('shama/ftp', '1.0.0', '1.0.0');
$package->setType('cakephp-whoops');
$result = $installer->getInstallPath($package);
}
/**
* testCustomInstallPath
*/
public function testCustomInstallPath()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('shama/ftp', '1.0.0', '1.0.0');
$package->setType('cakephp-plugin');
$this->composer->getPackage()->setExtra(array(
'installer-paths' => array(
'my/custom/path/{$name}/' => array(
'shama/ftp',
'foo/bar',
),
),
));
$result = $installer->getInstallPath($package);
$this->assertEquals('my/custom/path/Ftp/', $result);
}
/**
* testCustomInstallerName
*/
public function testCustomInstallerName()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
$package->setType('cakephp-plugin');
$package->setExtra(array(
'installer-name' => 'FTP',
));
$result = $installer->getInstallPath($package);
$this->assertEquals('Plugin/FTP/', $result);
}
/**
* testCustomTypePath
*/
public function testCustomTypePath()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
$package->setType('wordpress-plugin');
$this->composer->getPackage()->setExtra(array(
'installer-paths' => array(
'my/custom/path/{$name}/' => array(
'type:wordpress-plugin'
),
),
));
$result = $installer->getInstallPath($package);
$this->assertEquals('my/custom/path/my_plugin/', $result);
}
/**
* testVendorPath
*/
public function testVendorPath()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('penyaskito/my_module', '1.0.0', '1.0.0');
$package->setType('drupal-module');
$this->composer->getPackage()->setExtra(array(
'installer-paths' => array(
'modules/custom/{$name}/' => array(
'vendor:penyaskito'
),
),
));
$result = $installer->getInstallPath($package);
$this->assertEquals('modules/custom/my_module/', $result);
}
/**
* testStringPath
*/
public function testStringPath()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('penyaskito/my_module', '1.0.0', '1.0.0');
$package->setType('drupal-module');
$this->composer->getPackage()->setExtra(array(
'installer-paths' => array(
'modules/custom/{$name}/' => 'vendor:penyaskito',
),
));
$result = $installer->getInstallPath($package);
$this->assertEquals('modules/custom/my_module/', $result);
}
/**
* testNoVendorName
*/
public function testNoVendorName()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
$package->setType('symfony1-plugin');
$result = $installer->getInstallPath($package);
$this->assertEquals('plugins/sfPhpunitPlugin/', $result);
}
/**
* testTypo3Inflection
*/
public function testTypo3Inflection()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('typo3/fluid', '1.0.0', '1.0.0');
$package->setAutoload(array(
'psr-0' => array(
'TYPO3\\Fluid' => 'Classes',
),
));
$package->setType('typo3-flow-package');
$result = $installer->getInstallPath($package);
$this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
}
public function testUninstallAndDeletePackageFromLocalRepo()
{
$package = new Package('foo', '1.0.0', '1.0.0');
$installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
$installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
$repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
$repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
$repo->expects($this->once())->method('removePackage')->with($package);
$installer->uninstall($repo, $package);
}
/**
* testDisabledInstallers
*
* @dataProvider dataForTestDisabledInstallers
*/
public function testDisabledInstallers($disabled, $type, $expected)
{
$this->composer->getPackage()->setExtra(array(
'installer-disable' => $disabled,
));
$this->testSupports($type, $expected);
}
/**
* dataForTestDisabledInstallers
*
* @return array
*/
public function dataForTestDisabledInstallers()
{
return array(
array(false, "drupal-module", true),
array(true, "drupal-module", false),
array("true", "drupal-module", true),
array("all", "drupal-module", false),
array("*", "drupal-module", false),
array("cakephp", "drupal-module", true),
array("drupal", "cakephp-plugin", true),
array("cakephp", "cakephp-plugin", false),
array("drupal", "drupal-module", false),
array(array("drupal", "cakephp"), "cakephp-plugin", false),
array(array("drupal", "cakephp"), "drupal-module", false),
array(array("cakephp", true), "drupal-module", false),
array(array("cakephp", "all"), "drupal-module", false),
array(array("cakephp", "*"), "drupal-module", false),
array(array("cakephp", "true"), "drupal-module", true),
array(array("drupal", "true"), "cakephp-plugin", true),
);
}
}
PK cPQ&cƔ 6 tests/Composer/Installers/Test/BitrixInstallerTest.phpnu ٘ composer = new Composer();
}
/**
* @param string $vars
* @param string $expectedVars
*
* @covers ::inflectPackageVars
*
* @dataProvider provideExpectedInflectionResults
*/
final public function testInflectPackageVars($vars, $expectedVars)
{
$this->installer = new BitrixInstaller(
new Package($vars['name'], '4.2', '4.2'),
$this->composer
);
$actual = $this->installer->inflectPackageVars($vars);
$this->assertEquals($actual, $expectedVars);
}
/**
* Provides various parameters for packages and the expected result after inflection
*
* @return array
*/
final public function provideExpectedInflectionResults()
{
return array(
//check bitrix-dir is correct
array(
array('name' => 'Nyan/Cat'),
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
),
array(
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'),
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
),
array(
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'),
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local')
),
);
}
}
PK cPQ8"{ { + tests/Composer/Installers/Test/TestCase.phpnu ٘
* Jordi Boggiano
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Installers\Test;
use Composer\Package\Version\VersionParser;
use Composer\Package\Package;
use Composer\Package\AliasPackage;
use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Util\Filesystem;
use PHPUnit\Framework\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
private static $parser;
protected static function getVersionParser()
{
if (!self::$parser) {
self::$parser = new VersionParser();
}
return self::$parser;
}
protected function getVersionConstraint($operator, $version)
{
return new VersionConstraint(
$operator,
self::getVersionParser()->normalize($version)
);
}
protected function getPackage($name, $version)
{
$normVersion = self::getVersionParser()->normalize($version);
return new Package($name, $normVersion, $version);
}
protected function getAliasPackage($package, $version)
{
$normVersion = self::getVersionParser()->normalize($version);
return new AliasPackage($package, $normVersion, $version);
}
protected function ensureDirectoryExistsAndClear($directory)
{
$fs = new Filesystem();
if (is_dir($directory)) {
$fs->removeDirectory($directory);
}
mkdir($directory, 0777, true);
}
}
PK cPQ w 4 tests/Composer/Installers/Test/MayaInstallerTest.phpnu ٘ installer = new MayaInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
array('name' => $expected, 'type' => $type),
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
);
}
public function packageNameInflectionProvider()
{
return array(
// Should keep module name StudlyCase
array(
'maya-module',
'user-profile',
'UserProfile'
),
array(
'maya-module',
'maya-module',
'Maya'
),
array(
'maya-module',
'blog',
'Blog'
),
// tests that exactly one '-module' is cut off
array(
'maya-module',
'some-module-module',
'SomeModule',
),
);
}
}
PK cPQzs"vR R 8 tests/Composer/Installers/Test/OntoWikiInstallerTest.phpnu ٘ installer = new OntoWikiInstaller();
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
$this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
array('name' => $expected, 'type'=>$type)
);
}
public function packageNameInflectionProvider()
{
return array(
array(
'ontowiki-extension',
'CSVImport.ontowiki',
'csvimport',
),
array(
'ontowiki-extension',
'csvimport',
'csvimport',
),
array(
'ontowiki-extension',
'some_ontowiki_extension',
'some_ontowiki_extension',
),
array(
'ontowiki-extension',
'some_ontowiki_extension.ontowiki',
'some_ontowiki_extension',
),
array(
'ontowiki-translation',
'de-translation.ontowiki',
'de',
),
array(
'ontowiki-translation',
'en-US-translation.ontowiki',
'en-us',
),
array(
'ontowiki-translation',
'en-US-translation',
'en-us',
),
array(
'ontowiki-theme',
'blue-theme.ontowiki',
'blue',
),
array(
'ontowiki-theme',
'blue-theme',
'blue',
),
);
}
}
PK cPQ" 5 tests/Composer/Installers/Test/SyDESInstallerTest.phpnu ٘ installer = new SyDESInstaller(
new Package('NyanCat', '4.2', '4.2'),
new Composer()
);
}
/**
* @dataProvider packageNameInflectionProvider
*/
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
array('name' => $expected, 'type' => $type),
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
);
}
public function packageNameInflectionProvider()
{
return array(
// modules
array(
'sydes-module',
'name',
'Name'
),
array(
'sydes-module',
'sample-name',
'SampleName'
),
array(
'sydes-module',
'sydes-name',
'Name'
),
array(
'sydes-module',
'sample-name-module',
'SampleName',
),
array(
'sydes-module',
'sydes-sample-name-module',
'SampleName'
),
// themes
array(
'sydes-theme',
'some-theme-theme',
'some-theme',
),
array(
'sydes-theme',
'sydes-sometheme',
'sometheme',
),
array(
'sydes-theme',
'Sample-Name',
'sample-name'
),
);
}
}
PK cPQk& & 5 tests/Composer/Installers/Test/PiwikInstallerTest.phpnu ٘ package = new Package('VisitSummary', '1.0', '1.0');
$this->io = $this->getMock('Composer\IO\PackageInterface');
$this->composer = new Composer();
}
/**
* testInflectPackageVars
*
* @return void
*/
public function testInflectPackageVars()
{
$installer = new PiwikInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'VisitSummary'));
$this->assertEquals($result, array('name' => 'VisitSummary'));
$installer = new PiwikInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'visit-summary'));
$this->assertEquals($result, array('name' => 'VisitSummary'));
$installer = new PiwikInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => 'visit_summary'));
$this->assertEquals($result, array('name' => 'VisitSummary'));
}
}
PK cPQn
n
4 tests/Composer/Installers/Test/GravInstallerTest.phpnu ٘ composer = new Composer();
}
public function testInflectPackageVars()
{
$package = $this->getPackage('vendor/name', '0.0.0');
$installer = new GravInstaller($package, $this->composer);
$packageVars = $this->getPackageVars($package);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => 'test')));
$this->assertEquals('test', $result['name']);
foreach ($installer->getLocations() as $name => $location) {
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test")));
$this->assertEquals('test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-$name")));
$this->assertEquals('test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test-test")));
$this->assertEquals('test-test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-test-$name")));
$this->assertEquals('test-test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test")));
$this->assertEquals('test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-$name")));
$this->assertEquals('test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test-test")));
$this->assertEquals('test-test', $result['name']);
$result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-test-$name")));
$this->assertEquals('test-test', $result['name']);
}
}
/**
* @param $package \Composer\Package\PackageInterface
*/
public function getPackageVars($package)
{
$type = $package->getType();
$prettyName = $package->getPrettyName();
if (strpos($prettyName, '/') !== false) {
list($vendor, $name) = explode('/', $prettyName);
} else {
$vendor = '';
$name = $prettyName;
}
return compact('name', 'vendor', 'type');
}
}
PK cPQ#E
: tests/Composer/Installers/Test/SiteDirectInstallerTest.phpnu ٘ package = new Package('sitedirect/some_name', '1.0.9', '1.0');
$this->installer = new SiteDirectInstaller(
$this->package,
new Composer()
);
}
/**
* @dataProvider dataProvider
*/
public function testInflectPackageVars($data, $expected)
{
$result = $this->installer->inflectPackageVars($data);
$this->assertEquals($result, $expected);
}
/**
* @dataProvider dataProvider
*/
public function testInstallPath($data, $expected)
{
$result = $this->installer->inflectPackageVars($data);
$path = $this->createPackage($data);
// use $result to get the proper capitalization for the vendor path
$expectedPath = "modules/{$result['vendor']}/{$result['name']}/";
$notExpectedPath = "modules/{$data['vendor']}/{$data['name']}/";
$this->assertEquals($expectedPath, $path);
$this->assertNotEquals($notExpectedPath, $path);
}
/**
* @param $data
* @return string
*/
private function createPackage($data)
{
$fullName = "{$data['vendor']}/{$data['name']}";
$package = new Package($fullName, '1.0', '1.0');
$package->setType('sitedirect-module');
$installer = new SiteDirectInstaller($package, new Composer());
$path = $installer->getInstallPath($package, 'sitedirect');
return $path;
}
public function dataProvider()
{
return array(
array(
'data' => array(
'name' => 'kernel',
'vendor' => 'sitedirect',
'type' => 'sitedirect-module',
),
'expected' => array(
'name' => 'Kernel',
'vendor' => 'SiteDirect',
'type' => 'sitedirect-module',
)
),
array(
'data' => array(
'name' => 'that_guy',
'vendor' => 'whatGuy',
'type' => 'sitedirect-module',
),
'expected' => array(
'name' => 'ThatGuy',
'vendor' => 'whatGuy',
'type' => 'sitedirect-module',
)
),
array(
'data' => array(
'name' => 'checkout',
'vendor' => 'someVendor',
'type' => 'sitedirect-plugin',
),
'expected' => array(
'name' => 'Checkout',
'vendor' => 'someVendor',
'type' => 'sitedirect-plugin',
)
),
array(
'data' => array(
'name' => 'checkout',
'vendor' => 'siteDirect',
'type' => 'sitedirect-plugin',
),
'expected' => array(
'name' => 'Checkout',
'vendor' => 'SiteDirect',
'type' => 'sitedirect-plugin',
)
),
);
}
}
PK cPQ|z_ _ 5 tests/Composer/Installers/Test/CraftInstallerTest.phpnu ٘ installer = new CraftInstaller();
}
/**
* @param string $packageName
* @param string $expectedName
*
* @covers ::inflectPackageVars
*
* @dataProvider provideExpectedInflectionResults
*/
final public function testInflectPackageVars($packageName, $expectedName)
{
$installer = $this->installer;
$vars = array('name' => $packageName);
$expected = array('name' => $expectedName);
$actual = $installer->inflectPackageVars($vars);
$this->assertEquals($actual, $expected);
}
/**
* Provides various names for packages and the expected result after inflection
*
* @return array
*/
final public function provideExpectedInflectionResults()
{
return array(
// lowercase
array('foo', 'foo'),
array('craftfoo', 'craftfoo'),
array('fooplugin', 'fooplugin'),
array('craftfooplugin', 'craftfooplugin'),
// lowercase - dash
array('craft-foo', 'foo'),
array('foo-plugin', 'foo'),
array('craft-foo-plugin', 'foo'),
// lowercase - underscore
array('craft_foo', 'craft_foo'),
array('foo_plugin', 'foo_plugin'),
array('craft_foo_plugin', 'craft_foo_plugin'),
// CamelCase
array('Foo', 'Foo'),
array('CraftFoo', 'CraftFoo'),
array('FooPlugin', 'FooPlugin'),
array('CraftFooPlugin', 'CraftFooPlugin'),
// CamelCase - Dash
array('Craft-Foo', 'Foo'),
array('Foo-Plugin', 'Foo'),
array('Craft-Foo-Plugin', 'Foo'),
// CamelCase - underscore
array('Craft_Foo', 'Craft_Foo'),
array('Foo_Plugin', 'Foo_Plugin'),
array('Craft_Foo_Plugin', 'Craft_Foo_Plugin'),
);
}
}
PK cPQ6& & LICENSEnu ٘ Copyright (c) 2012 Kyle Robinson Young
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.PK cPQ>3} }
composer.jsonnu ٘ {
"name": "composer/installers",
"type": "composer-plugin",
"license": "MIT",
"description": "A multi-framework Composer library installer",
"keywords": [
"installer",
"Aimeos",
"AGL",
"AnnotateCms",
"Attogram",
"Bitrix",
"CakePHP",
"Chef",
"Cockpit",
"CodeIgniter",
"concrete5",
"Craft",
"Croogo",
"DokuWiki",
"Dolibarr",
"Drupal",
"Elgg",
"Eliasis",
"ExpressionEngine",
"eZ Platform",
"FuelPHP",
"Grav",
"Hurad",
"ImageCMS",
"iTop",
"Joomla",
"Kanboard",
"Known",
"Kohana",
"Lan Management System",
"Laravel",
"Lavalite",
"Lithium",
"Magento",
"majima",
"Mako",
"MantisBT",
"Mautic",
"Maya",
"MODX",
"MODX Evo",
"MediaWiki",
"OXID",
"osclass",
"MODULEWork",
"Moodle",
"Piwik",
"pxcms",
"phpBB",
"Plentymarkets",
"PPI",
"Puppet",
"Porto",
"RadPHP",
"ReIndex",
"Roundcube",
"shopware",
"SilverStripe",
"SMF",
"SyDES",
"Sylius",
"symfony",
"Thelia",
"TYPO3",
"WHMCS",
"WolfCMS",
"WordPress",
"YAWIK",
"Zend",
"Zikula"
],
"homepage": "https://composer.github.io/installers/",
"authors": [
{
"name": "Kyle Robinson Young",
"email": "kyle@dontkry.com",
"homepage": "https://github.com/shama"
}
],
"autoload": {
"psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
},
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"replace": {
"shama/baton": "*",
"roundcube/plugin-installer": "*"
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer": "1.6.* || 2.0.*@dev",
"composer/semver": "^1 || ^3",
"phpunit/phpunit": "^4.8.36",
"sebastian/comparator": "^1.2.4",
"symfony/process": "^2.3"
},
"scripts": {
"test": "phpunit"
}
}
PK cPQ.g .travis.ymlnu ٘ PK cPQ6V _config.ymlnu ٘ PK cPQb, , 2 README.mdnu ٘ PK cPQk . CONTRIBUTING.mdnu ٘ PK cPQ0L
R3 .gitignorenu ٘ PK cPQ7to 3 src/bootstrap.phpnu ٘ PK cPQ^ + 5 src/Composer/Installers/ZikulaInstaller.phpnu ٘ PK cPQ! + 6 src/Composer/Installers/MoodleInstaller.phpnu ٘ PK cPQ]h ) EC src/Composer/Installers/ZendInstaller.phpnu ٘ PK cPQM ( D src/Composer/Installers/TaoInstaller.phpnu ٘ PK cPQ ) H src/Composer/Installers/MayaInstaller.phpnu ٘ PK cPQjn n . wK src/Composer/Installers/Concrete5Installer.phpnu ٘ PK cPQ>H - CM src/Composer/Installers/LavaLiteInstaller.phpnu ٘ PK cPQ 1 8 N src/Composer/Installers/LanManagementSystemInstaller.phpnu ٘ PK cPQy* , Q src/Composer/Installers/FuelphpInstaller.phpnu ٘ PK cPQږ + R src/Composer/Installers/SyliusInstaller.phpnu ٘ PK cPQ_ , S src/Composer/Installers/CiviCrmInstaller.phpnu ٘ PK cPQO + T src/Composer/Installers/PuppetInstaller.phpnu ٘ PK cPQ6B ) U src/Composer/Installers/ItopInstaller.phpnu ٘ PK cPQ , V src/Composer/Installers/ReIndexInstaller.phpnu ٘ PK cPQh0 , X src/Composer/Installers/PimcoreInstaller.phpnu ٘ PK cPQ/J 6 Z src/Composer/Installers/ClanCatsFrameworkInstaller.phpnu ٘ PK cPQˇ .U U + [ src/Composer/Installers/MauticInstaller.phpnu ٘ PK cPQg i * o^ src/Composer/Installers/PiwikInstaller.phpnu ٘ PK cPQ?`7 , a src/Composer/Installers/DecibelInstaller.phpnu ٘ PK cPQ= / b src/Composer/Installers/MicroweberInstaller.phpnu ٘ PK cPQ@я1 1 , s src/Composer/Installers/EliasisInstaller.phpnu ٘ PK cPQ? ) du src/Composer/Installers/MakoInstaller.phpnu ٘ PK cPQ7 / hv src/Composer/Installers/SiteDirectInstaller.phpnu ٘ PK cPQ - Uy src/Composer/Installers/DokuWikiInstaller.phpnu ٘ PK cPQ84 ( ~ src/Composer/Installers/SMFInstaller.phpnu ٘ PK cPQ|X]D . src/Composer/Installers/RoundcubeInstaller.phpnu ٘ PK cPQW& & * src/Composer/Installers/CraftInstaller.phpnu ٘ PK cPQb| 2 g src/Composer/Installers/PlentymarketsInstaller.phpnu ٘ PK cPQlκT T . src/Composer/Installers/WordPressInstaller.phpnu ٘ PK cPQidΦ * D src/Composer/Installers/YawikInstaller.phpnu ٘ PK cPQ / D src/Composer/Installers/PrestashopInstaller.phpnu ٘ PK cPQKB,c c + u src/Composer/Installers/DrupalInstaller.phpnu ٘ PK cPQfn n - 3 src/Composer/Installers/ShopwareInstaller.phpnu ٘ PK cPQ2 * src/Composer/Installers/PortoInstaller.phpnu ٘ PK cPQLF F * src/Composer/Installers/WHMCSInstaller.phpnu ٘ PK cPQNn3 , src/Composer/Installers/LaravelInstaller.phpnu ٘ PK cPQ( + src/Composer/Installers/TheliaInstaller.phpnu ٘ PK cPQɽ] ) src/Composer/Installers/ChefInstaller.phpnu ٘ PK cPQ*p ) š src/Composer/Installers/ElggInstaller.phpnu ٘ PK cPQ0nb b - src/Composer/Installers/DolibarrInstaller.phpnu ٘ PK cPQ8} } - ~ src/Composer/Installers/TYPO3CmsInstaller.phpnu ٘ PK cPQG * X src/Composer/Installers/KirbyInstaller.phpnu ٘ PK cPQ2 0 src/Composer/Installers/AnnotateCmsInstaller.phpnu ٘ PK cPQ!u\ - 5 src/Composer/Installers/BonefishInstaller.phpnu ٘ PK cPQNÄ + I src/Composer/Installers/KohanaInstaller.phpnu ٘ PK cPQP7B B + K src/Composer/Installers/MajimaInstaller.phpnu ٘ PK cPQA> 1 src/Composer/Installers/UserFrostingInstaller.phpnu ٘ PK cPQ۳' ' , src/Composer/Installers/OsclassInstaller.phpnu ٘ PK cPQk + src/Composer/Installers/RedaxoInstaller.phpnu ٘ PK cPQt , src/Composer/Installers/VanillaInstaller.phpnu ٘ PK cPQ:T6 / src/Composer/Installers/EzPlatformInstaller.phpnu ٘ PK cPQ"wس + c src/Composer/Installers/DframeInstaller.phpnu ٘ PK cPQy( ( % q src/Composer/Installers/Installer.phpnu ٘ PK cPQW W 1 src/Composer/Installers/SilverStripeInstaller.phpnu ٘ PK cPQ̞f ) src/Composer/Installers/OxidInstaller.phpnu ٘ PK cPQwc ( src/Composer/Installers/AglInstaller.phpnu ٘ PK cPQBq + src/Composer/Installers/JoomlaInstaller.phpnu ٘ PK cPQ]%: ) src/Composer/Installers/GravInstaller.phpnu ٘ PK cPQÚ ) src/Composer/Installers/TuskInstaller.phpnu ٘ PK cPQE3 - src/Composer/Installers/OntoWikiInstaller.phpnu ٘ PK cPQ
.. . + src/Composer/Installers/AsgardInstaller.phpnu ٘ PK cPQ) o , k src/Composer/Installers/LithiumInstaller.phpnu ٘ PK cPQMNY$ $ - src/Composer/Installers/ImageCMSInstaller.phpnu ٘ PK cPQ' + &