diff --git a/README.md b/README.md index 1410b5ef..2208021d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ is **not needed** to install packages with these frameworks. | Framework | Types | --------- | ----- +| Akaunting | `akaunting-module` | Asgard | `asgard-module`
`asgard-theme` | Attogram | `attogram-module` | AGL | `agl-module` diff --git a/src/Composer/Installers/AkauntingInstaller.php b/src/Composer/Installers/AkauntingInstaller.php new file mode 100644 index 00000000..c504c70f --- /dev/null +++ b/src/Composer/Installers/AkauntingInstaller.php @@ -0,0 +1,23 @@ + */ + protected $locations = array( + 'module' => 'modules/{$name}', + ); + + /** + * Format package name to CamelCase + */ + public function inflectPackageVars(array $vars): array + { + $vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name'])); + $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); + $vars['name'] = str_replace(' ', '', ucwords($vars['name'])); + + return $vars; + } +} diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index 5e34941a..490681cf 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -20,6 +20,7 @@ class Installer extends LibraryInstaller * @var array */ private $supportedTypes = array( + 'akaunting' => 'AkauntingInstaller', 'asgard' => 'AsgardInstaller', 'attogram' => 'AttogramInstaller', 'agl' => 'AglInstaller', diff --git a/tests/Composer/Installers/Test/InstallerTest.php b/tests/Composer/Installers/Test/InstallerTest.php index f9b7ae57..b51241db 100644 --- a/tests/Composer/Installers/Test/InstallerTest.php +++ b/tests/Composer/Installers/Test/InstallerTest.php @@ -83,6 +83,7 @@ public function supportsProvider(): array { return array( array('agl-module', true), + array('akaunting-module', true), array('annotatecms-module', true), array('annotatecms-component', true), array('annotatecms-service', true), @@ -270,6 +271,7 @@ public function installPathProvider(): array { return array( array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'), + array('akaunting-module', 'modules/MyPackage', 'shama/MyPackage'), 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'),