plugin updates
This commit is contained in:
@@ -8,6 +8,9 @@ env:
|
||||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
||||
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "CI"
|
||||
|
||||
@@ -4,6 +4,9 @@ on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "Lint"
|
||||
|
||||
@@ -8,6 +8,9 @@ env:
|
||||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
||||
SYMFONY_PHPUNIT_VERSION: ""
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "PHPStan"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"Cockpit",
|
||||
"CodeIgniter",
|
||||
"concrete5",
|
||||
"ConcreteCMS",
|
||||
"Croogo",
|
||||
"DokuWiki",
|
||||
"Dolibarr",
|
||||
@@ -102,15 +103,15 @@
|
||||
"composer-plugin-api": "^1.0 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "1.6.* || ^2.0",
|
||||
"composer/semver": "^1 || ^3",
|
||||
"symfony/phpunit-bridge": "^5.3",
|
||||
"phpstan/phpstan": "^0.12.55",
|
||||
"symfony/process": "^5",
|
||||
"phpstan/phpstan-phpunit": "^0.12.16"
|
||||
"composer/composer": "^1.10.27 || ^2.7",
|
||||
"composer/semver": "^1.7.2 || ^3.4.0",
|
||||
"symfony/phpunit-bridge": "^7.1.1",
|
||||
"phpstan/phpstan": "^1.11",
|
||||
"symfony/process": "^5 || ^6 || ^7",
|
||||
"phpstan/phpstan-phpunit": "^1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/simple-phpunit",
|
||||
"phpstan": "vendor/bin/phpstan analyse"
|
||||
"test": "@php vendor/bin/simple-phpunit",
|
||||
"phpstan": "@php vendor/bin/phpstan analyse"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
parameters:
|
||||
level: 8
|
||||
paths:
|
||||
- src
|
||||
- tests
|
||||
excludes_analyse:
|
||||
- tests/Composer/Installers/Test/PolyfillTestCase.php
|
||||
ignoreErrors:
|
||||
- '~Test::[a-zA-Z0-9]+Provider\(\) return type~'
|
||||
|
||||
includes:
|
||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class BotbleInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'plugin' => 'platform/plugins/{$name}/',
|
||||
'theme' => 'platform/themes/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class CakePHPInstaller extends BaseInstaller
|
||||
/**
|
||||
* Check if CakePHP version matches against a version
|
||||
*
|
||||
* @phpstan-param Constraint::STR_OP_* $matcher
|
||||
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $matcher
|
||||
*/
|
||||
protected function matchesCakeVersion(string $matcher, string $version): bool
|
||||
{
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ConcreteCMSInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = array(
|
||||
'core' => 'concrete/',
|
||||
'block' => 'application/blocks/{$name}/',
|
||||
'package' => 'packages/{$name}/',
|
||||
'theme' => 'application/themes/{$name}/',
|
||||
'update' => 'updates/{$name}/',
|
||||
);
|
||||
}
|
||||
@@ -20,5 +20,6 @@ class DrupalInstaller extends BaseInstaller
|
||||
'console' => 'console/{$name}/',
|
||||
'console-language' => 'console/language/{$name}/',
|
||||
'config' => 'config/sync/',
|
||||
'recipe' => 'recipes/{$name}',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Composer\Installers;
|
||||
|
||||
class ForkCMSInstaller extends BaseInstaller
|
||||
{
|
||||
/** @var array<string, string> */
|
||||
protected $locations = [
|
||||
'module' => 'src/Modules/{$name}/',
|
||||
'theme' => 'src/Themes/{$name}/'
|
||||
];
|
||||
|
||||
/**
|
||||
* Format package name.
|
||||
*
|
||||
* For package type fork-cms-module, cut off a trailing '-plugin' if present.
|
||||
*
|
||||
* For package type fork-cms-theme, cut off a trailing '-theme' if present.
|
||||
*/
|
||||
public function inflectPackageVars(array $vars): array
|
||||
{
|
||||
if ($vars['type'] === 'fork-cms-module') {
|
||||
return $this->inflectModuleVars($vars);
|
||||
}
|
||||
|
||||
if ($vars['type'] === 'fork-cms-theme') {
|
||||
return $this->inflectThemeVars($vars);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectModuleVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/^fork-cms-|-module|ForkCMS|ForkCms|Forkcms|forkcms|Module$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); // replace hyphens with spaces
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); // make module name camelcased
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $vars
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function inflectThemeVars(array $vars): array
|
||||
{
|
||||
$vars['name'] = $this->pregReplace('/^fork-cms-|-theme|ForkCMS|ForkCms|Forkcms|forkcms|Theme$/', '', $vars['name']);
|
||||
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); // replace hyphens with spaces
|
||||
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); // make theme name camelcased
|
||||
|
||||
return $vars;
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ class Installer extends LibraryInstaller
|
||||
'agl' => 'AglInstaller',
|
||||
'annotatecms' => 'AnnotateCmsInstaller',
|
||||
'bitrix' => 'BitrixInstaller',
|
||||
'botble' => 'BotbleInstaller',
|
||||
'bonefish' => 'BonefishInstaller',
|
||||
'cakephp' => 'CakePHPInstaller',
|
||||
'chef' => 'ChefInstaller',
|
||||
@@ -34,6 +35,7 @@ class Installer extends LibraryInstaller
|
||||
'cockpit' => 'CockpitInstaller',
|
||||
'codeigniter' => 'CodeIgniterInstaller',
|
||||
'concrete5' => 'Concrete5Installer',
|
||||
'concretecms' => 'ConcreteCMSInstaller',
|
||||
'croogo' => 'CroogoInstaller',
|
||||
'dframe' => 'DframeInstaller',
|
||||
'dokuwiki' => 'DokuWikiInstaller',
|
||||
@@ -45,6 +47,7 @@ class Installer extends LibraryInstaller
|
||||
'ee3' => 'ExpressionEngineInstaller',
|
||||
'ee2' => 'ExpressionEngineInstaller',
|
||||
'ezplatform' => 'EzPlatformInstaller',
|
||||
'fork' => 'ForkCMSInstaller',
|
||||
'fuel' => 'FuelInstaller',
|
||||
'fuelphp' => 'FuelphpInstaller',
|
||||
'grav' => 'GravInstaller',
|
||||
@@ -145,6 +148,9 @@ class Installer extends LibraryInstaller
|
||||
}
|
||||
|
||||
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
|
||||
/**
|
||||
* @var BaseInstaller
|
||||
*/
|
||||
$installer = new $class($package, $this->composer, $this->getIO());
|
||||
|
||||
$path = $installer->getInstallPath($package, $frameworkType);
|
||||
@@ -178,6 +184,8 @@ class Installer extends LibraryInstaller
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param string $packageType
|
||||
*/
|
||||
public function supports($packageType)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ class MoodleInstaller extends BaseInstaller
|
||||
'cachestore' => 'cache/stores/{$name}/',
|
||||
'cachelock' => 'cache/locks/{$name}/',
|
||||
'calendartype' => 'calendar/type/{$name}/',
|
||||
'communication' => 'communication/provider/{$name}/',
|
||||
'customfield' => 'customfield/field/{$name}/',
|
||||
'fileconverter' => 'files/converter/{$name}/',
|
||||
'format' => 'course/format/{$name}/',
|
||||
@@ -33,20 +34,24 @@ class MoodleInstaller extends BaseInstaller
|
||||
'editor' => 'lib/editor/{$name}/',
|
||||
'enrol' => 'enrol/{$name}/',
|
||||
'filter' => 'filter/{$name}/',
|
||||
'forumreport' => 'mod/forum/report/{$name}/',
|
||||
'gradeexport' => 'grade/export/{$name}/',
|
||||
'gradeimport' => 'grade/import/{$name}/',
|
||||
'gradereport' => 'grade/report/{$name}/',
|
||||
'gradingform' => 'grade/grading/form/{$name}/',
|
||||
'h5plib' => 'h5p/h5plib/{$name}/',
|
||||
'local' => 'local/{$name}/',
|
||||
'logstore' => 'admin/tool/log/store/{$name}/',
|
||||
'ltisource' => 'mod/lti/source/{$name}/',
|
||||
'ltiservice' => 'mod/lti/service/{$name}/',
|
||||
'media' => 'media/player/{$name}/',
|
||||
'message' => 'message/output/{$name}/',
|
||||
'mlbackend' => 'lib/mlbackend/{$name}/',
|
||||
'mnetservice' => 'mnet/service/{$name}/',
|
||||
'paygw' => 'payment/gateway/{$name}/',
|
||||
'plagiarism' => 'plagiarism/{$name}/',
|
||||
'portfolio' => 'portfolio/{$name}/',
|
||||
'qbank' => 'question/bank/{$name}/',
|
||||
'qbehaviour' => 'question/behaviour/{$name}/',
|
||||
'qformat' => 'question/format/{$name}/',
|
||||
'qtype' => 'question/type/{$name}/',
|
||||
@@ -57,6 +62,7 @@ class MoodleInstaller extends BaseInstaller
|
||||
'scormreport' => 'mod/scorm/report/{$name}/',
|
||||
'search' => 'search/engine/{$name}/',
|
||||
'theme' => 'theme/{$name}/',
|
||||
'tiny' => 'lib/editor/tiny/plugins/{$name}/',
|
||||
'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
|
||||
'profilefield' => 'user/profile/field/{$name}/',
|
||||
'webservice' => 'webservice/{$name}/',
|
||||
|
||||
Reference in New Issue
Block a user