initial commit
This commit is contained in:
10
exp/vendor/composer/installers/.editorconfig
vendored
Normal file
10
exp/vendor/composer/installers/.editorconfig
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
; top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
; Unix-style newlines
|
||||
[*]
|
||||
end_of_line = LF
|
||||
|
||||
[*.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
3
exp/vendor/composer/installers/.gitignore
vendored
Normal file
3
exp/vendor/composer/installers/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
vendor/
|
||||
composer.lock
|
||||
.idea/
|
||||
21
exp/vendor/composer/installers/.travis.yml
vendored
Normal file
21
exp/vendor/composer/installers/.travis.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: 7.0
|
||||
|
||||
before_script:
|
||||
- composer self-update
|
||||
- composer install
|
||||
|
||||
script:
|
||||
- composer test
|
||||
19
exp/vendor/composer/installers/LICENSE
vendored
Normal file
19
exp/vendor/composer/installers/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
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.
|
||||
220
exp/vendor/composer/installers/README.md
vendored
Normal file
220
exp/vendor/composer/installers/README.md
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
# A Multi-Framework [Composer](http://getcomposer.org) Library Installer
|
||||
|
||||
[](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.
|
||||
|
||||
**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`<br>`asgard-theme`
|
||||
| Attogram | `attogram-module`
|
||||
| AGL | `agl-module`
|
||||
| Bonefish | `bonefish-package`
|
||||
| AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
|
||||
| Bitrix | `bitrix-module` (deprecated) <br>`bitrix-component` (deprecated) <br>`bitrix-theme` (deprecated) <br><br> `bitrix-d7-module` <br> `bitrix-d7-component` <br> `bitrix-d7-template`
|
||||
| CakePHP 2+ | **`cakephp-plugin`**
|
||||
| Chef | `chef-cookbook`<br>`chef-role`
|
||||
| CCFramework | `ccframework-ship`<br>`ccframework-theme`
|
||||
| Cockpit | `cockpit-module`
|
||||
| CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
|
||||
| concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
|
||||
| Craft | `craft-plugin`
|
||||
| Croogo | `croogo-plugin`<br>`croogo-theme`
|
||||
| Decibel | `decibel-app`
|
||||
| DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
|
||||
| Dolibarr | `dolibarr-module`
|
||||
| Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
|
||||
| Elgg | `elgg-plugin`
|
||||
| ExpressionEngine 3 | `ee3-addon`<br>`ee3-theme`
|
||||
| FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
|
||||
| FuelPHP v2.x | `fuelphp-component`
|
||||
| Grav | `grav-plugin`<br>`grav-theme`
|
||||
| Hurad | `hurad-plugin`<br>`hurad-theme`
|
||||
| ImageCMS | `imagecms-template`<br>`imagecms-module`<br>`imagecms-library`
|
||||
| Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
|
||||
| Kirby | **`kirby-plugin`**<br>`kirby-field`<br>`kirby-tag`
|
||||
| KodiCMS | `kodicms-plugin`<br>`kodicms-media`
|
||||
| Kohana | **`kohana-module`**
|
||||
| Laravel | `laravel-library`
|
||||
| Lithium | **`lithium-library`<br>`lithium-source`**
|
||||
| Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
|
||||
| Mako | `mako-package`
|
||||
| Mautic | `mautic-plugin`<br>`mautic-theme`
|
||||
| MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
|
||||
| MediaWiki | `mediawiki-extension`
|
||||
| October | **`october-module`<br>`october-plugin`<br>`october-theme`**
|
||||
| OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
|
||||
| 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`<br>`phpbb-style`<br>`phpbb-language`
|
||||
| Pimcore | `pimcore-plugin`
|
||||
| Plentymarkets | `plentymarkets-plugin`
|
||||
| PPI | **`ppi-module`**
|
||||
| Puppet | `puppet-module`
|
||||
| RadPHP | `radphp-bundle`
|
||||
| REDAXO | `redaxo-addon`
|
||||
| ReIndex | **`reindex-plugin`** <br> **`reindex-theme`**
|
||||
| Roundcube | `roundcube-plugin`
|
||||
| shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`<br/>`shopware-plugin`<br/>`shopware-frontend-theme`
|
||||
| SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
|
||||
| SMF | `smf-module`<br>`smf-theme`
|
||||
| symfony1 | **`symfony1-plugin`**
|
||||
| Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
|
||||
| TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
|
||||
| TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
|
||||
| Vanilla | `vanilla-plugin`<br>`vanilla-theme`
|
||||
| Wolf CMS | `wolfcms-plugin`
|
||||
| WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
|
||||
| YAWIK | `yawik-module`
|
||||
| Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
|
||||
| Zikula | `zikula-module`<br>`zikula-theme`
|
||||
| Prestashop | `prestashop-module`<br>`prestashop-theme`
|
||||
| Phifty | `phifty-bundle`<br>`phifty-framework`<br>`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.
|
||||
|
||||
## Contribute!
|
||||
|
||||
* [Fork and clone](https://help.github.com/articles/fork-a-repo).
|
||||
* Run the command `php composer.phar install` to install the dependencies.
|
||||
This will also install the dev dependencies. See [Composer](https://getcomposer.org/doc/03-cli.md#install).
|
||||
* Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
|
||||
* 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](http://symfony.com/doc/2.0/contributing/code/standards.html)
|
||||
which we borrowed from Symfony.
|
||||
|
||||
If you would like to help, please take a look at the list of
|
||||
[issues](https://github.com/composer/installers/issues).
|
||||
|
||||
### 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.
|
||||
92
exp/vendor/composer/installers/composer.json
vendored
Normal file
92
exp/vendor/composer/installers/composer.json
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"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",
|
||||
"ExpressionEngine",
|
||||
"FuelPHP",
|
||||
"Grav",
|
||||
"Hurad",
|
||||
"ImageCMS",
|
||||
"Joomla",
|
||||
"Kohana",
|
||||
"Laravel",
|
||||
"Lithium",
|
||||
"Magento",
|
||||
"Mako",
|
||||
"Mautic",
|
||||
"MODX Evo",
|
||||
"MediaWiki",
|
||||
"OXID",
|
||||
"MODULEWork",
|
||||
"Moodle",
|
||||
"Piwik",
|
||||
"phpBB",
|
||||
"Plentymarkets",
|
||||
"PPI",
|
||||
"Puppet",
|
||||
"RadPHP",
|
||||
"ReIndex",
|
||||
"Roundcube",
|
||||
"shopware",
|
||||
"SilverStripe",
|
||||
"SMF",
|
||||
"symfony",
|
||||
"Thelia",
|
||||
"TYPO3",
|
||||
"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"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "1.0.*@dev",
|
||||
"phpunit/phpunit": "4.1.*"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "phpunit"
|
||||
}
|
||||
}
|
||||
25
exp/vendor/composer/installers/phpunit.xml.dist
vendored
Normal file
25
exp/vendor/composer/installers/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Installers Test Suite">
|
||||
<directory>tests/Composer/Installers</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>src/Composer/Installers</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
21
exp/vendor/composer/installers/src/Composer/Installers/AglInstaller.php
vendored
Normal file
21
exp/vendor/composer/installers/src/Composer/Installers/AglInstaller.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AglInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '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;
|
||||
}
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AimeosInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$name}/',
|
||||
);
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AnnotateCmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'addons/modules/{$name}/',
|
||||
'component' => 'addons/components/{$name}/',
|
||||
'service' => 'addons/services/{$name}/',
|
||||
);
|
||||
}
|
||||
49
exp/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
vendored
Normal file
49
exp/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AsgardInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '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;
|
||||
}
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class AttogramInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
136
exp/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
vendored
Normal file
136
exp/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Composer;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
abstract class BaseInstaller
|
||||
{
|
||||
protected $locations = array();
|
||||
protected $composer;
|
||||
protected $package;
|
||||
protected $io;
|
||||
|
||||
/**
|
||||
* Initializes base installer.
|
||||
*
|
||||
* @param PackageInterface $package
|
||||
* @param Composer $composer
|
||||
* @param IOInterface $io
|
||||
*/
|
||||
public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
|
||||
{
|
||||
$this->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) {
|
||||
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
126
exp/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
vendored
Normal file
126
exp/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Util\Filesystem;
|
||||
|
||||
/**
|
||||
* Installer for Bitrix Framework. Supported types of extensions:
|
||||
* - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
|
||||
* - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
|
||||
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
|
||||
*
|
||||
* You can set custom path to directory with Bitrix kernel in `composer.json`:
|
||||
*
|
||||
* ```json
|
||||
* {
|
||||
* "extra": {
|
||||
* "bitrix-dir": "s1/bitrix"
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @author Nik Samokhvalov <nik@samokhvalov.info>
|
||||
* @author Denis Kulichkin <onexhovia@gmail.com>
|
||||
*/
|
||||
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(' <error>Duplication of packages:</error>');
|
||||
$this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
|
||||
|
||||
while (true) {
|
||||
switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BonefishInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'Packages/{$vendor}/{$name}/'
|
||||
);
|
||||
}
|
||||
84
exp/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
vendored
Normal file
84
exp/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\DependencyResolver\Pool;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class CakePHPInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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) {
|
||||
$repos = $repositoryManager->getLocalRepository();
|
||||
if (!$repos) {
|
||||
return false;
|
||||
}
|
||||
$cake3 = new $multiClass(array(
|
||||
new $constraintClass($matcher, $version),
|
||||
new $constraintClass('!=', '9999999-dev'),
|
||||
));
|
||||
$pool = new Pool('dev');
|
||||
$pool->addRepository($repos);
|
||||
$packages = $pool->whatProvides('cakephp/cakephp');
|
||||
foreach ($packages as $package) {
|
||||
$installed = new $constraintClass('=', $package->getVersion());
|
||||
if ($cake3->matches($installed)) {
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ChefInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'cookbook' => 'Chef/{$vendor}/{$name}/',
|
||||
'role' => 'Chef/roles/{$name}/',
|
||||
);
|
||||
}
|
||||
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ClanCatsFrameworkInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'ship' => 'CCF/orbit/{$name}/',
|
||||
'theme' => 'CCF/app/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
34
exp/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
vendored
Normal file
34
exp/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CockpitInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '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;
|
||||
}
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CodeIgniterInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
'third-party' => 'application/third_party/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
);
|
||||
}
|
||||
12
exp/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php
vendored
Normal file
12
exp/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class Concrete5Installer extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'block' => 'blocks/{$name}/',
|
||||
'package' => 'packages/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'update' => 'updates/{$name}/',
|
||||
);
|
||||
}
|
||||
35
exp/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php
vendored
Normal file
35
exp/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Installer for Craft Plugins
|
||||
*/
|
||||
class CraftInstaller extends BaseInstaller
|
||||
{
|
||||
const NAME_PREFIX = 'craft';
|
||||
const NAME_SUFFIX = 'plugin';
|
||||
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
21
exp/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php
vendored
Normal file
21
exp/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class CroogoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DecibelInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array */
|
||||
protected $locations = array(
|
||||
'app' => 'app/{$name}/',
|
||||
);
|
||||
}
|
||||
50
exp/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php
vendored
Normal file
50
exp/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DokuWikiInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
|
||||
}
|
||||
16
exp/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php
vendored
Normal file
16
exp/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class DolibarrInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
* @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*/
|
||||
class DolibarrInstaller extends BaseInstaller
|
||||
{
|
||||
//TODO: Add support for scripts and themes
|
||||
protected $locations = array(
|
||||
'module' => 'htdocs/custom/{$name}/',
|
||||
);
|
||||
}
|
||||
16
exp/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
vendored
Normal file
16
exp/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class DrupalInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'core' => 'core/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'profile' => 'profiles/{$name}/',
|
||||
'drush' => 'drush/{$name}/',
|
||||
'custom-theme' => 'themes/custom/{$name}/',
|
||||
'custom-module' => 'modules/custom/{$name}',
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ElggInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'mod/{$name}/',
|
||||
);
|
||||
}
|
||||
29
exp/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
vendored
Normal file
29
exp/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class ExpressionEngineInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array();
|
||||
|
||||
private $ee2Locations = array(
|
||||
'addon' => '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);
|
||||
}
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'fuel/app/modules/{$name}/',
|
||||
'package' => 'fuel/packages/{$name}/',
|
||||
'theme' => 'fuel/app/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class FuelphpInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
);
|
||||
}
|
||||
30
exp/vendor/composer/installers/src/Composer/Installers/GravInstaller.php
vendored
Normal file
30
exp/vendor/composer/installers/src/Composer/Installers/GravInstaller.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class GravInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
25
exp/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php
vendored
Normal file
25
exp/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class HuradInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ImageCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'template' => 'templates/{$name}/',
|
||||
'module' => 'application/modules/{$name}/',
|
||||
'library' => 'application/libraries/{$name}/',
|
||||
);
|
||||
}
|
||||
189
exp/vendor/composer/installers/src/Composer/Installers/Installer.php
vendored
Normal file
189
exp/vendor/composer/installers/src/Composer/Installers/Installer.php
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Installer\LibraryInstaller;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Repository\InstalledRepositoryInterface;
|
||||
|
||||
class Installer extends LibraryInstaller
|
||||
{
|
||||
/**
|
||||
* Package types to installer class map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $supportedTypes = array(
|
||||
'aimeos' => 'AimeosInstaller',
|
||||
'asgard' => 'AsgardInstaller',
|
||||
'attogram' => 'AttogramInstaller',
|
||||
'agl' => 'AglInstaller',
|
||||
'annotatecms' => 'AnnotateCmsInstaller',
|
||||
'bitrix' => 'BitrixInstaller',
|
||||
'bonefish' => 'BonefishInstaller',
|
||||
'cakephp' => 'CakePHPInstaller',
|
||||
'chef' => 'ChefInstaller',
|
||||
'ccframework' => 'ClanCatsFrameworkInstaller',
|
||||
'cockpit' => 'CockpitInstaller',
|
||||
'codeigniter' => 'CodeIgniterInstaller',
|
||||
'concrete5' => 'Concrete5Installer',
|
||||
'craft' => 'CraftInstaller',
|
||||
'croogo' => 'CroogoInstaller',
|
||||
'dokuwiki' => 'DokuWikiInstaller',
|
||||
'dolibarr' => 'DolibarrInstaller',
|
||||
'decibel' => 'DecibelInstaller',
|
||||
'drupal' => 'DrupalInstaller',
|
||||
'elgg' => 'ElggInstaller',
|
||||
'ee3' => 'ExpressionEngineInstaller',
|
||||
'ee2' => 'ExpressionEngineInstaller',
|
||||
'fuel' => 'FuelInstaller',
|
||||
'fuelphp' => 'FuelphpInstaller',
|
||||
'grav' => 'GravInstaller',
|
||||
'hurad' => 'HuradInstaller',
|
||||
'imagecms' => 'ImageCMSInstaller',
|
||||
'joomla' => 'JoomlaInstaller',
|
||||
'kirby' => 'KirbyInstaller',
|
||||
'kodicms' => 'KodiCMSInstaller',
|
||||
'kohana' => 'KohanaInstaller',
|
||||
'laravel' => 'LaravelInstaller',
|
||||
'lithium' => 'LithiumInstaller',
|
||||
'magento' => 'MagentoInstaller',
|
||||
'mako' => 'MakoInstaller',
|
||||
'mautic' => 'MauticInstaller',
|
||||
'mediawiki' => 'MediaWikiInstaller',
|
||||
'microweber' => 'MicroweberInstaller',
|
||||
'modulework' => 'MODULEWorkInstaller',
|
||||
'modxevo' => 'MODXEvoInstaller',
|
||||
'moodle' => 'MoodleInstaller',
|
||||
'october' => 'OctoberInstaller',
|
||||
'oxid' => 'OxidInstaller',
|
||||
'phpbb' => 'PhpBBInstaller',
|
||||
'pimcore' => 'PimcoreInstaller',
|
||||
'piwik' => 'PiwikInstaller',
|
||||
'plentymarkets'=> 'PlentymarketsInstaller',
|
||||
'ppi' => 'PPIInstaller',
|
||||
'puppet' => 'PuppetInstaller',
|
||||
'radphp' => 'RadPHPInstaller',
|
||||
'phifty' => 'PhiftyInstaller',
|
||||
'redaxo' => 'RedaxoInstaller',
|
||||
'reindex' => 'ReIndexInstaller',
|
||||
'roundcube' => 'RoundcubeInstaller',
|
||||
'shopware' => 'ShopwareInstaller',
|
||||
'silverstripe' => 'SilverStripeInstaller',
|
||||
'smf' => 'SMFInstaller',
|
||||
'symfony1' => 'Symfony1Installer',
|
||||
'thelia' => 'TheliaInstaller',
|
||||
'tusk' => 'TuskInstaller',
|
||||
'typo3-cms' => 'TYPO3CmsInstaller',
|
||||
'typo3-flow' => 'TYPO3FlowInstaller',
|
||||
'vanilla' => 'VanillaInstaller',
|
||||
'whmcs' => 'WHMCSInstaller',
|
||||
'wolfcms' => 'WolfCMSInstaller',
|
||||
'wordpress' => 'WordPressInstaller',
|
||||
'yawik' => 'YawikInstaller',
|
||||
'zend' => 'ZendInstaller',
|
||||
'zikula' => 'ZikulaInstaller',
|
||||
'prestashop' => 'PrestashopInstaller'
|
||||
);
|
||||
|
||||
/**
|
||||
* {@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)
|
||||
{
|
||||
if (!$repo->hasPackage($package)) {
|
||||
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
||||
}
|
||||
|
||||
$repo->removePackage($package);
|
||||
|
||||
$installPath = $this->getInstallPath($package);
|
||||
$this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@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;
|
||||
}
|
||||
}
|
||||
15
exp/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php
vendored
Normal file
15
exp/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class JoomlaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'component' => 'components/{$name}/',
|
||||
'module' => 'modules/{$name}/',
|
||||
'template' => 'templates/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
);
|
||||
|
||||
// TODO: Add inflector for mod_ and com_ names
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KirbyInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'site/plugins/{$name}/',
|
||||
'field' => 'site/fields/{$name}/',
|
||||
'tag' => 'site/tags/{$name}/'
|
||||
);
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KodiCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'cms/plugins/{$name}/',
|
||||
'media' => 'cms/media/vendor/{$name}/'
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class KohanaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LaravelInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
);
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class LithiumInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'libraries/{$name}/',
|
||||
'source' => 'libraries/_source/{$name}/',
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MODULEWorkInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
16
exp/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php
vendored
Normal file
16
exp/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle MODX Evolution specifics when installing packages.
|
||||
*/
|
||||
class MODXEvoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'snippet' => 'assets/snippets/{$name}/',
|
||||
'plugin' => 'assets/plugins/{$name}/',
|
||||
'module' => 'assets/modules/{$name}/',
|
||||
'template' => 'assets/templates/{$name}/',
|
||||
'lib' => 'assets/lib/{$name}/'
|
||||
);
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MagentoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'app/design/frontend/{$name}/',
|
||||
'skin' => 'skin/frontend/default/{$name}/',
|
||||
'library' => 'lib/{$name}/',
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MakoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => 'app/packages/{$name}/',
|
||||
);
|
||||
}
|
||||
25
exp/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
vendored
Normal file
25
exp/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MauticInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
|
||||
}
|
||||
50
exp/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php
vendored
Normal file
50
exp/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MediaWikiInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'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;
|
||||
}
|
||||
|
||||
}
|
||||
111
exp/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
vendored
Normal file
111
exp/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MicroweberInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'userfiles/modules/{$name}/',
|
||||
'module-skin' => 'userfiles/modules/{$name}/templates/',
|
||||
'template' => 'userfiles/templates/{$name}/',
|
||||
'element' => 'userfiles/elements/{$name}/',
|
||||
'vendor' => 'vendor/{$name}/',
|
||||
'components' => 'components/{$name}/'
|
||||
);
|
||||
|
||||
/**
|
||||
* 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 ($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['name'] = preg_replace('/-template$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/template-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectTemplatesVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-templates$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/templates-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectCoreVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-providers$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-provider$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-adapter$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModuleVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/module-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectModulesVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-modules$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/modules-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectSkinVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/skin-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectElementVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-elements$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/elements-$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/-element$/', '', $vars['name']);
|
||||
$vars['name'] = preg_replace('/element-$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
56
exp/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
vendored
Normal file
56
exp/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class MoodleInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'mod' => '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}/',
|
||||
'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}/',
|
||||
'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}/'
|
||||
);
|
||||
}
|
||||
46
exp/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php
vendored
Normal file
46
exp/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class OctoberInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '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('/-plugin$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
protected function inflectThemeVars($vars)
|
||||
{
|
||||
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
59
exp/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php
vendored
Normal file
59
exp/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class OxidInstaller extends BaseInstaller
|
||||
{
|
||||
const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PPIInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhiftyInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'bundle' => 'bundles/{$name}/',
|
||||
'library' => 'libraries/{$name}/',
|
||||
'framework' => 'frameworks/{$name}/',
|
||||
);
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PhpBBInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'ext/{$vendor}/{$name}/',
|
||||
'language' => 'language/{$name}/',
|
||||
'style' => 'styles/{$name}/',
|
||||
);
|
||||
}
|
||||
21
exp/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php
vendored
Normal file
21
exp/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PimcoreInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
32
exp/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php
vendored
Normal file
32
exp/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Class PiwikInstaller
|
||||
*
|
||||
* @package Composer\Installers
|
||||
*/
|
||||
class PiwikInstaller extends BaseInstaller
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
29
exp/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
vendored
Normal file
29
exp/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PlentymarketsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '{$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;
|
||||
}
|
||||
}
|
||||
17
exp/vendor/composer/installers/src/Composer/Installers/Plugin.php
vendored
Normal file
17
exp/vendor/composer/installers/src/Composer/Installers/Plugin.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
|
||||
class Plugin implements PluginInterface
|
||||
{
|
||||
|
||||
public function activate(Composer $composer, IOInterface $io)
|
||||
{
|
||||
$installer = new Installer($io, $composer);
|
||||
$composer->getInstallationManager()->addInstaller($installer);
|
||||
}
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PrestashopInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class PuppetInstaller extends BaseInstaller
|
||||
{
|
||||
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$name}/',
|
||||
);
|
||||
}
|
||||
24
exp/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
vendored
Normal file
24
exp/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class RadPHPInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'bundle' => '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;
|
||||
}
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ReIndexInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'theme' => 'themes/{$name}/',
|
||||
'plugin' => 'plugins/{$name}/'
|
||||
);
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class RedaxoInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'addon' => 'redaxo/include/addons/{$name}/',
|
||||
'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
|
||||
);
|
||||
}
|
||||
22
exp/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php
vendored
Normal file
22
exp/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class RoundcubeInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => '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;
|
||||
}
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class SMFInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'Sources/{$name}/',
|
||||
'theme' => 'Themes/{$name}/',
|
||||
);
|
||||
}
|
||||
60
exp/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php
vendored
Normal file
60
exp/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Plugin/theme installer for shopware
|
||||
* @author Benjamin Boit
|
||||
*/
|
||||
class ShopwareInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'backend-plugin' => '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);
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
36
exp/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php
vendored
Normal file
36
exp/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
class SilverStripeInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '{$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'));
|
||||
} else {
|
||||
return parent::getInstallPath($package, $frameworkType);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
26
exp/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php
vendored
Normal file
26
exp/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Plugin installer for symfony 1.x
|
||||
*
|
||||
* @author Jérôme Tamarelle <jerome@tamarelle.net>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
16
exp/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php
vendored
Normal file
16
exp/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* Extension installer for TYPO3 CMS
|
||||
*
|
||||
* @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
|
||||
*
|
||||
* @author Sascha Egerer <sascha.egerer@dkd.de>
|
||||
*/
|
||||
class TYPO3CmsInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'extension' => 'typo3conf/ext/{$name}/',
|
||||
);
|
||||
}
|
||||
38
exp/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php
vendored
Normal file
38
exp/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
/**
|
||||
* An installer to handle TYPO3 Flow specifics when installing packages.
|
||||
*/
|
||||
class TYPO3FlowInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'package' => '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;
|
||||
}
|
||||
}
|
||||
12
exp/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php
vendored
Normal file
12
exp/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class TheliaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'local/modules/{$name}/',
|
||||
'frontoffice-template' => 'templates/frontOffice/{$name}/',
|
||||
'backoffice-template' => 'templates/backOffice/{$name}/',
|
||||
'email-template' => 'templates/email/{$name}/',
|
||||
);
|
||||
}
|
||||
14
exp/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php
vendored
Normal file
14
exp/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
/**
|
||||
* Composer installer for 3rd party Tusk utilities
|
||||
* @author Drew Ewing <drew@phenocode.com>
|
||||
*/
|
||||
class TuskInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'task' => '.tusk/tasks/{$name}/',
|
||||
'command' => '.tusk/commands/{$name}/',
|
||||
'asset' => 'assets/tusk/{$name}/',
|
||||
);
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class VanillaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'plugins/{$name}/',
|
||||
'theme' => 'themes/{$name}/',
|
||||
);
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class WHMCSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'gateway' => 'modules/gateways/{$name}/',
|
||||
);
|
||||
}
|
||||
9
exp/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php
vendored
Normal file
9
exp/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class WolfCMSInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'wolf/plugins/{$name}/',
|
||||
);
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class WordPressInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'plugin' => 'wp-content/plugins/{$name}/',
|
||||
'theme' => 'wp-content/themes/{$name}/',
|
||||
'muplugin' => 'wp-content/mu-plugins/{$name}/',
|
||||
);
|
||||
}
|
||||
32
exp/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php
vendored
Normal file
32
exp/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: cbleek
|
||||
* Date: 25.03.16
|
||||
* Time: 20:55
|
||||
*/
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
|
||||
class YawikInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => '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;
|
||||
}
|
||||
}
|
||||
11
exp/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php
vendored
Normal file
11
exp/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ZendInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'library' => 'library/{$name}/',
|
||||
'extra' => 'extras/library/{$name}/',
|
||||
'module' => 'module/{$name}/',
|
||||
);
|
||||
}
|
||||
10
exp/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php
vendored
Normal file
10
exp/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ZikulaInstaller extends BaseInstaller
|
||||
{
|
||||
protected $locations = array(
|
||||
'module' => 'modules/{$vendor}-{$name}/',
|
||||
'theme' => 'themes/{$vendor}-{$name}/'
|
||||
);
|
||||
}
|
||||
13
exp/vendor/composer/installers/src/bootstrap.php
vendored
Normal file
13
exp/vendor/composer/installers/src/bootstrap.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
function includeIfExists($file)
|
||||
{
|
||||
if (file_exists($file)) {
|
||||
return include $file;
|
||||
}
|
||||
}
|
||||
if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
|
||||
die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
|
||||
'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
|
||||
'php composer.phar install'.PHP_EOL);
|
||||
}
|
||||
return $loader;
|
||||
79
exp/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php
vendored
Normal file
79
exp/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\AsgardInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Composer;
|
||||
|
||||
class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var AsgardInstaller
|
||||
*/
|
||||
private $installer;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->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'
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
76
exp/vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php
vendored
Normal file
76
exp/vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\BitrixInstaller;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Composer;
|
||||
|
||||
/**
|
||||
* Tests for the BitrixInstaller Class
|
||||
*
|
||||
* @coversDefaultClass Composer\Installers\BitrixInstaller
|
||||
*/
|
||||
class BitrixInstallerTest extends TestCase
|
||||
{
|
||||
/** @var BitrixInstaller */
|
||||
private $installer;
|
||||
|
||||
/** @var Composer */
|
||||
private $composer;
|
||||
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, instantiate the class-under-test.
|
||||
*
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
final function setUp()
|
||||
{
|
||||
$this->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')
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
115
exp/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php
vendored
Normal file
115
exp/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\CakePHPInstaller;
|
||||
use Composer\Repository\RepositoryManager;
|
||||
use Composer\Repository\InstalledArrayRepository;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Package\RootPackage;
|
||||
use Composer\Package\Link;
|
||||
use Composer\Package\Version\VersionParser;
|
||||
use Composer\Composer;
|
||||
use Composer\Config;
|
||||
|
||||
class CakePHPInstallerTest extends TestCase
|
||||
{
|
||||
private $composer;
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* setUp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->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;
|
||||
$rm = new RepositoryManager(
|
||||
$this->getMock('Composer\IO\IOInterface'),
|
||||
$this->getMock('Composer\Config')
|
||||
);
|
||||
$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']);
|
||||
|
||||
// special handling for 2.x versions when 3.x is still in development
|
||||
$this->setCakephpVersion($rm, 'dev-master');
|
||||
$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);
|
||||
}
|
||||
|
||||
}
|
||||
83
exp/vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php
vendored
Normal file
83
exp/vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\CraftInstaller;
|
||||
|
||||
/**
|
||||
* Tests for the CraftInstaller Class
|
||||
*
|
||||
* @coversDefaultClass Composer\Installers\CraftInstaller
|
||||
*/
|
||||
class CraftInstallerTest extends TestCase
|
||||
{
|
||||
/** @var CraftInstaller */
|
||||
private $installer;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, instantiate the class-under-test.
|
||||
*
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
final public function setup()
|
||||
{
|
||||
$this->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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
89
exp/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php
vendored
Normal file
89
exp/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\DokuWikiInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Composer;
|
||||
|
||||
class DokuWikiInstallerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var DokuWikiInstaller
|
||||
*/
|
||||
private $installer;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->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',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
63
exp/vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php
vendored
Normal file
63
exp/vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\Installers\GravInstaller;
|
||||
|
||||
class GravInstallerTest extends TestCase
|
||||
{
|
||||
/* @var \Composer\Composer */
|
||||
protected $composer;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->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');
|
||||
}
|
||||
}
|
||||
496
exp/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php
vendored
Normal file
496
exp/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php
vendored
Normal file
@@ -0,0 +1,496 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\Installer;
|
||||
use Composer\Util\Filesystem;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Package\RootPackage;
|
||||
use Composer\Composer;
|
||||
use Composer\Config;
|
||||
|
||||
class InstallerTest extends TestCase
|
||||
{
|
||||
private $composer;
|
||||
private $config;
|
||||
private $vendorDir;
|
||||
private $binDir;
|
||||
private $dm;
|
||||
private $repository;
|
||||
private $io;
|
||||
private $fs;
|
||||
|
||||
/**
|
||||
* setUp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->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');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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-update', true),
|
||||
array('craft-plugin', true),
|
||||
array('croogo-plugin', true),
|
||||
array('croogo-theme', true),
|
||||
array('decibel-app', true),
|
||||
array('dokuwiki-plugin', true),
|
||||
array('dokuwiki-template', true),
|
||||
array('drupal-module', 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('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('joomla-library', true),
|
||||
array('kirby-plugin', true),
|
||||
array('kohana-module', true),
|
||||
array('laravel-library', true),
|
||||
array('lithium-library', true),
|
||||
array('magento-library', true),
|
||||
array('mako-package', 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('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('radphp-bundle', true),
|
||||
array('redaxo-addon', true),
|
||||
array('redaxo-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('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('vanilla-plugin', true),
|
||||
array('vanilla-theme', true),
|
||||
array('whmcs-gateway', 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),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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', 'blocks/concrete5_block/', 'remo/concrete5_block'),
|
||||
array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
|
||||
array('concrete5-theme', 'themes/concrete5_theme/', 'remo/concrete5_theme'),
|
||||
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('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-module', 'modules/my_module/', 'shama/my_module'),
|
||||
array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
|
||||
array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
|
||||
array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
|
||||
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
|
||||
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('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('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
|
||||
array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
|
||||
array('kohana-module', 'modules/my_package/', 'shama/my_package'),
|
||||
array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
|
||||
array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
|
||||
array('magento-library', 'lib/foo/', 'test/foo'),
|
||||
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('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('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('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('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('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('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
|
||||
array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
|
||||
array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_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'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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');
|
||||
$consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
|
||||
$this->composer->setPackage($consumerPackage);
|
||||
$consumerPackage->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');
|
||||
$consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
|
||||
$this->composer->setPackage($consumerPackage);
|
||||
$consumerPackage->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');
|
||||
$consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0');
|
||||
$this->composer->setPackage($consumerPackage);
|
||||
$consumerPackage->setExtra(array(
|
||||
'installer-paths' => array(
|
||||
'modules/custom/{$name}/' => array(
|
||||
'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->once())->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);
|
||||
}
|
||||
}
|
||||
66
exp/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php
vendored
Normal file
66
exp/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\MediaWikiInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Composer;
|
||||
|
||||
class MediaWikiInstallerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var MediaWikiInstaller
|
||||
*/
|
||||
private $installer;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->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',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
66
exp/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php
vendored
Normal file
66
exp/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\OctoberInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Composer;
|
||||
|
||||
class OctoberInstallerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var OctoberInstaller
|
||||
*/
|
||||
private $installer;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->installer = new OctoberInstaller(
|
||||
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(
|
||||
'october-plugin',
|
||||
'subpagelist',
|
||||
'subpagelist',
|
||||
),
|
||||
array(
|
||||
'october-plugin',
|
||||
'subpagelist-plugin',
|
||||
'subpagelist',
|
||||
),
|
||||
array(
|
||||
'october-plugin',
|
||||
'semanticoctober',
|
||||
'semanticoctober',
|
||||
),
|
||||
// tests that exactly one '-theme' is cut off
|
||||
array(
|
||||
'october-theme',
|
||||
'some-theme-theme',
|
||||
'some-theme',
|
||||
),
|
||||
// tests that names without '-theme' suffix stay valid
|
||||
array(
|
||||
'october-theme',
|
||||
'someothertheme',
|
||||
'someothertheme',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
44
exp/vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php
vendored
Normal file
44
exp/vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Installers\PimcoreInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Composer;
|
||||
|
||||
class PimcoreInstallerTest extends TestCase
|
||||
{
|
||||
private $composer;
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* setUp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->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'));
|
||||
}
|
||||
}
|
||||
63
exp/vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php
vendored
Normal file
63
exp/vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\Installers\PiwikInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
/**
|
||||
* Class PiwikInstallerTest
|
||||
*
|
||||
* @package Composer\Installers\Test
|
||||
*/
|
||||
class PiwikInstallerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @varComposer
|
||||
*/
|
||||
private $composer;
|
||||
|
||||
/**
|
||||
* @var PackageInterface
|
||||
*/
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* @var Package
|
||||
*/
|
||||
private $package;
|
||||
|
||||
/**
|
||||
* setUp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->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'));
|
||||
}
|
||||
|
||||
}
|
||||
64
exp/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php
vendored
Normal file
64
exp/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* 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;
|
||||
|
||||
abstract class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
64
exp/vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php
vendored
Normal file
64
exp/vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
namespace Composer\Installers\Test;
|
||||
|
||||
use Composer\Composer;
|
||||
use Composer\Installers\YawikInstaller;
|
||||
use Composer\Package\Package;
|
||||
use Composer\Package\PackageInterface;
|
||||
|
||||
/**
|
||||
* Class YawikInstallerTest
|
||||
*
|
||||
* @package Composer\Installers\Test
|
||||
*/
|
||||
class YawikInstallerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @varComposer
|
||||
*/
|
||||
private $composer;
|
||||
|
||||
/**
|
||||
* @var PackageInterface
|
||||
*/
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* @var Package
|
||||
*/
|
||||
private $package;
|
||||
|
||||
/**
|
||||
* setUp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->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')
|
||||
);
|
||||
}
|
||||
}
|
||||
4
exp/vendor/composer/installers/tests/bootstrap.php
vendored
Normal file
4
exp/vendor/composer/installers/tests/bootstrap.php
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
$loader = require __DIR__ . '/../src/bootstrap.php';
|
||||
$loader->add('Composer\Installers\Test', __DIR__);
|
||||
Reference in New Issue
Block a user