Giter Club home page Giter Club logo

store-plugin-installer's Introduction

Install plugins from Store during composer install

Deprecated:

Use native composer repository https://packages.friendsofshopware.com/ instead

What do you need?

  • Shopware Composer Installation
  • Shopware Account Credentials
  • PHP 7.0 or higher
  • Normal Domain and not wildcard

Setup

Add the plugins in the extra section in your composer.json

Example composer.json

{
    "name": "shopware/composer-project",
    "description": "Project template for Shopware projects with composer",
    "type": "project",
    "license": "MIT",
    "authors": [
        {
            "name": "Shopware",
            "email": "[email protected]"
        }
    ],
    "autoload": {
        "classmap": [ "app/AppKernel.php" ]
    },
    "require": {
        "php": "^5.6.4||^7.0",
        "composer/installers": "^1.0",
        "shopware/shopware": "^5.4",
        "vlucas/phpdotenv": "~2.0 || ~3.3",
        "shyim/store-plugin-installer": "dev-master"
    },
    "extra": {
        "installer-paths": {
            "Plugins/Local/Backend/{$name}/": ["type:shopware-backend-plugin"],
            "Plugins/Local/Core/{$name}/": ["type:shopware-core-plugin"],
            "Plugins/Local/Frontend/{$name}/": ["type:shopware-frontend-plugin"]
        },
        "plugins": {
            "production": {
                "SwagPaymentPaypal": "3.4.5"
            }
        }
    },
    "include-path": [
        "engine/Library/"
    ],
    "config": {
        "optimize-autoloader": true,
        "process-timeout": 0
    },
    "scripts": {
        "post-root-package-install": [
           "./app/post-install.sh"
        ],
        "post-install-cmd": [
           "./app/post-install.sh"
        ],
        "post-update-cmd":[
           "./app/post-update.sh"
        ]
    }
}

Set following environment variables

  • ACCOUNT_USER (Shopware User)
  • ACCOUNT_PASSWORD (Shopware Password)
  • SW_STORE_PLUGIN_INSTALLER_SILENTFAIL (do not throw exceptions on errors / default: `false``)

Install the composer plugin

composer require shyim/store-plugin-installer

Aaaaaaaand the Plugins should be installed

FAQ

BinariesException-14

Reasons can be:

  • You are not logged in
  • The SHOP_URL environment variable does not equal the from account

Versions

Versions can be a constraint or a exact version

store-plugin-installer's People

Contributors

arosenhagen avatar forestsoft-de avatar nlubisch avatar shyim avatar studioforty9-dev avatar xndrdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

store-plugin-installer's Issues

FR: cache directory configurable via ENV variable

For build processes, which don't have access to $HOME (or in our case => Gitlab-CI you can't cache $HOME easily), it would be great if you could modify the plugin cache directory via e.g. $COMPOSER_SW_PLUGIN_DIR or similar.

Constructor args required

public function __construct(Client $client, array $extra)

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Shyim\PluginInstaller::__construct(), 0 passed in phar:///www/casamia.local/releases/43/src/bin/composer.phar/src/Composer/Plugin/PluginManager.php on line 2
04 and exactly 2 expected in /www/casamia.local/releases/43/src/vendor/shyim/store-plugin-installer/src/Shyim/PluginInstaller.php:27
Stack trace:
#0 phar:///www/casamia.local/releases/43/src/bin/composer.phar/src/Composer/Plugin/PluginManager.php(204): Shyim\PluginInstaller->__construct()

on composer update with a fresh composer installation.

Unauthorized

Getting the following error when running composer update:

[Installer] Fetching shop licenses failed with code "PluginLicensesException-8" !

The login details work fine to login to the account in a browser. Just wondering if anything has changed with the API like the last time.

Latest Version and Plugin Code versus Name

This works great now - thanks :)

Is there anyway to just install the latest version of the plugin or for it to at least notify the developer on install that a newer version is available?

Also, when viewing a plugin in my Shopware Account, I'm actually seeing the Plugin "Code" rather than the Name. For example, "Shopware Storytelling" plugin shows the code "Swag986953104487". Nowhere does it show the Plugin name that's required for composer installation (i.e., "SwagEmotionAdvanced"). I needed to var_dump the API response to discover this.

License issue

Hi,

since shortly we have the following issue running composer install and composer update:

[InvalidArgumentException]
Could not download plugin XY in version X.Y.Z maybe not a valid licence for this version

Stacktrace:

Exception trace:
() at/home/dev/project/mieb//vendor/shyim/store-plugin-installer/src/Shyim/PluginInstaller.php:94
Shyim\PluginInstaller->movePlugin() at/home/dev/project/mieb//vendor/shyim/store-plugin-installer/src/Shyim/PluginInstaller.php:79
Shyim\PluginInstaller->installPlugin() at/home/dev/project/mieb//vendor/shyim/store-plugin-installer/src/Shyim/ComposerPlugin.php:82
Shyim\ComposerPlugin::installPlugins() at n/a:n/a
call_user_func() at phar:///home/dev/composer//bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:176
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///home/dev/composer//bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:96
Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///home/dev/composer//bin/composer.phar/src/Composer/Installer.php:323
Composer\Installer->run() at phar:///home/dev/composer//bin/composer.phar/src/Composer/Command/InstallCommand.php:121
Composer\Command\InstallCommand->execute() at phar:///home/dev/composer//bin/composer.phar/vendor/symfony/console/Command/Command.php:241
Symfony\Component\Console\Command\Command->run() at phar:///home/dev/composer//bin/composer.phar/vendor/symfony/console/Application.php:843
Symfony\Component\Console\Application->doRunCommand() at phar:///home/dev/composer//bin/composer.phar/vendor/symfony/console/Application.php:193
Symfony\Component\Console\Application->doRun() at phar:///home/dev/composer//bin/composer.phar/src/Composer/Console/Application.php:254
Composer\Console\Application->doRun() at phar:///home/dev/composer//bin/composer.phar/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///home/dev/composer//bin/composer.phar/src/Composer/Console/Application.php:103
Composer\Console\Application->run() at phar:///home/dev/composer//bin/composer.phar/bin/composer:56
require() at /home/dev/composer//bin/composer.phar:24

Do you know if the shopware store api has changed recently which causes the error? It just works perfectly last week .

We have no license issues with the Webstore on https://store.shopware.com or via /backend.

Thanks in advance!

Best regards,
Josh

FR: Support simple version number constraints

It would be great if the plugin could support simple version number constraints like 3.*

I know this could lead to the use of unspecific plugin versions. Our use case would be to use wildcard version numbers to check the latest version of a plugin during development but to narrow down to an exact version for production/staging.

Example:

"extra": {
        "plugins": {
            "dev": {
                "SwagPromotion": "3.*",
                "SwagFuzzy": "3.2.*"
            },
            "production": {
                "SwagPromotion": "3.0.0",
                "SwagFuzzy": "3.2.1"
            }
        }
    },

Wildcard Umgebung

Hey there seems an issue with Wildcard Account. In our Store Backend I have configured the following Site.

bildschirmfoto 2018-09-06 um 15 30 08

On the given Server in our Docker Enviroment I getting this Error:

bildschirmfoto 2018-09-06 um 15 32 57

That's the interesting part of composer.json

"extra": { "installer-paths": { "Plugins/Local/Backend/{$name}/": [ "type:shopware-backend-plugin" ], "Plugins/Local/Core/{$name}/": [ "type:shopware-core-plugin" ], "Plugins/Local/Frontend/{$name}/": [ "type:shopware-frontend-plugin" ] }, "plugins":{ "production":{ "SwagCustomProducts": "4.2.0" } } },

Fatal Error when running plugin installer

When running composer require shyim/store-plugin-installer, I get

PHP Fatal error: Uncaught Error: Call to a member function write() on null in /vendor/shyim/store-plugin-installer/src/Shyim/Api/Client.php:46

Seems like the singleton Shyim\Composer is not available at that point. Any way to fix this?

PHP 7.4.3
Shopware 5.6.7

Shops and Licenses

Shops are only setup on the Merchant's Shopware Account. As an Agency, we don't have the username/password of the Merchant even though their domain is linked to our Shopware account under "Licenses" and we can view/download the purchased plugins.

Is there any way to change the code so it retrieves Licenses rather than Shops from our "linked" Shopware account.

thanks,

Alan.

Plugins are not removed when removed from composer.json

Plugins that get installed using this method do not appear to be removed if their entry is removed from composer.json.

Before:

    "plugins": {
        "dev": {
            "SwagEnterpriseSearch": "2.2.1",
            "SwagDigitalPublishing": "3.3.0",
            "SwagEmotionAdvanced": "3.2.1"
        },

$ composer install

[Installer] Using $ACCOUNT_USER and $ACCOUNT_PASSWORD to login into the account
[Installer] Successfully loggedin in the account
[Installer] Account is partner account
[Installer] Found shop with domain "redact.ed" in account
[Installer] Using plugin "SwagEnterpriseSearch" with version 2.2.1 from cache
[Installer] Using plugin "SwagDigitalPublishing" with version 3.3.0 from cache
[Installer] Using plugin "SwagEmotionAdvanced" with version 3.2.1 from cache

$ ls custom/plugins

SwagDigitalPublishing	SwagEmotionAdvanced	SwagEnterpriseSearch

After:

    "plugins": {
        "dev": {
            "SwagEnterpriseSearch": "2.2.1",
            "SwagEmotionAdvanced": "3.2.1"
        },

$ composer update

[Installer] Using $ACCOUNT_USER and $ACCOUNT_PASSWORD to login into the account
[Installer] Successfully loggedin in the account
[Installer] Account is partner account
[Installer] Found shop with domain "redact.ed" in account
[Installer] Using plugin "SwagEnterpriseSearch" with version 2.2.1 from cache
[Installer] Using plugin "SwagEmotionAdvanced" with version 3.2.1 from cache

$ ls custom/plugins

SwagDigitalPublishing	SwagEmotionAdvanced	SwagEnterpriseSearch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.