Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New actions for plugins API: viewSettings, reload, install #6551

Open
wants to merge 4 commits into
base: staging
from

Conversation

Projects
None yet
2 participants
@kuzmany
Copy link
Contributor

kuzmany commented Sep 10, 2018

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL tba
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

New API endpoint plugins:

  • $apiPlugins->reload() - (inspirated by #6201.)
  • $apiPlugins->getSettings($integrationName);
  • $apiPlugins->install($package)

Steps to test this PR:

Require this API PR mautic/api-library#169

  1. Apply PR and setup API

getSettings

$apiPlugins = $api->newApi('plugins', $auth, $apiUrl);
$response =  $apiPlugins->getSettings('Pipedrive');
die(print_r($response));

Response should be
`

Response

Array
(
    [update_mautic] => Array
        (
            [Company] => 1
            [Email] => 1
            [LastName] => 0
            [City] => 1
            [FirstName] => 1
        )

    [leadFields] => Array
        (
            [Company] => company
            [Email] => email
            [LastName] => lastname
            [City] => city
            [FirstName] => firstname
        )

    [updateBlanks] => Array
        (
        )

    [objects] => Array
        (
            [0] => Leads
            [1] => Contacts
        )

)

install

$apiPlugins = $api->newApi('plugins', $auth, $apiUrl);
$response =  $apiPlugins->install('kuzmany/mautic-netsuite-bundle');
die(print_r($response));

Response should be

Some strings like If you're running composer require kuzmany/mautic-netsuite-bundle in console.

reload

$apiPlugins = $api->newApi('plugins', $auth, $apiUrl);
$response = $apiPlugins->reload();
die(print_r($response));

Response should be
`
Array ( [response] => 0 new plugins were installed and 0 updated. )

@kuzmany kuzmany added this to the 2.15.0 milestone Sep 10, 2018

@kuzmany kuzmany added WIP and removed Ready To Test labels Sep 11, 2018

kuzmany added some commits Sep 11, 2018

@kuzmany kuzmany added Ready To Test and removed WIP labels Sep 11, 2018

@kuzmany

This comment has been minimized.

Copy link
Contributor Author

kuzmany commented Sep 12, 2018

@dongilbert as author of composer plugin please can you review my solution for installation plugin from packageist with API

Usage

$apiPlugins = $api->newApi('plugins', $auth, $apiUrl);
$response =  $apiPlugins->install('kuzmany/mautic-netsuite-bundle');

Code use shell_exec.
I can add check for shell_exec extension later.
This solution works for me, or exist another solution for install plugin from packageist with PHP code?

https://github.com/mautic/mautic/pull/6551/files#diff-83e1d6de27868da82b05d2e563a579abR63

Thanks for help.

@kuzmany kuzmany changed the title Install plugins by API New actions for plugins API: viewSettings, reload, install Sep 12, 2018

@npracht npracht added this to To do in Testing 2.15.0 Oct 16, 2018

@npracht npracht modified the milestones: 2.15.0, 2.16.0 Dec 4, 2018

@Woeler Woeler removed this from To do in Testing 2.15.0 Dec 5, 2018

@heathdutton heathdutton added this to Code Review (2 required) in Mautic 2 Dec 6, 2018

@heathdutton heathdutton removed this from Code Review (2 required) in Mautic 2 Dec 6, 2018

@npracht npracht added this to Ready to Test (first time) in Mautic 2 Jan 3, 2019

@npracht npracht modified the milestone: 2.16.0 Jan 3, 2019

@npracht npracht removed this from Ready to Test (first time) in Mautic 2 Jan 3, 2019

@npracht npracht added the API label Feb 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.