Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
feat(debug): add dev option to install
Browse files Browse the repository at this point in the history
Signed-off-by: Naylin <nmedina@teclib.com>
  • Loading branch information
Naylin15 authored and DIOHz0r committed Apr 24, 2018
1 parent 595037e commit 59d7a92
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tools/cli_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@
cli_install.php
Usage:
cli_install.php [--as-user USER] [--api-user-token APITOKEN] [--enable-api ] [--enable-email ] [ --tests ]
cli_install.php [--as-user USER] [--api-user-token APITOKEN] [--enable-api ] [--enable-email ] [ --tests ] [--dev]
Options:
--as-user USER Do install/upgrade as specified USER. If not provided, 'glpi' user will be used
--api-user-token APITOKEN APITOKEN
--enable-api Enable GLPI's API
--enable-email Enable GLPI's email notification
--tests Use GLPI test database
--dev Change the Agent download URL for the Beta testing url
DOC;

Expand Down Expand Up @@ -118,6 +119,7 @@
Session::init($auth);

$apiUserToken = $args['--api-user-token'];
$dev = $args['--dev'];

/*---------------------------------------------------------------------*/

Expand Down Expand Up @@ -156,6 +158,17 @@
WHERE `name` like 'full access from localhost'";
$DB->query($apiClientQuery);

if($dev) {
$entityConfig = new PluginFlyvemdmEntityConfig();
$entityConfig->getFromDBByCrit([
'entities_id' => '0',
]);
$devquery = "UPDATE `glpi_plugin_flyvemdm_entityconfigs`
SET `download_url` = '" . PLUGIN_FLYVEMDM_AGENT_BETA_DOWNLOAD_URL . "'
WHERE `glpi_plugin_flyvemdm_entityconfigs`.`entities_id` = 0";
$DB->query($devquery);
}

// Enable the plugin
print("Activating Plugin...\n");
$plugin->activate($plugin->fields['id']);
Expand Down

0 comments on commit 59d7a92

Please sign in to comment.